[MDEV-19193] The --wsrep-new-cluster option does not reset wsrep_cluster_state_uuid and wsrep_last_committed Created: 2019-04-05 Updated: 2020-08-25 Resolved: 2019-05-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Galera, wsrep |
| Affects Version/s: | 10.1.38, 10.2.23, 10.3.14 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Daniele Sciascia |
| Resolution: | Not a Bug | Votes: | 3 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
galera_new_cluster bootstraps a new cluster. However, when this happens, the cluster keeps its old state. For example:
If it's a "new" cluster, wouldn't it make sense to start with a new UUID and seqno? galera_new_cluster starts "mysqld --wsrep-new-cluster" using systemd under the hood. I don't believe that this is a systemd or galera_new_cluster problem, because this still happens if you bypass systemd and start "mysqld --wsrep-new-cluster" directly. For example:
In order to reset 'wsrep_cluster_state_uuid' and 'wsrep_last_committed', you have to manually delete grastate.dat:
You can see from above that wsrep_start_position is still not reset when mysqld is started with systemd. This is because MariaDB's systemd unit file has an ExecStartPre option defined that recovers this position using the galera_recovery wrapper script: https://github.com/MariaDB/server/blob/mariadb-10.1.39/support-files/mariadb.service.in#L72 https://github.com/MariaDB/server/blob/mariadb-10.1.39/scripts/galera_recovery.sh |
| Comments |
| Comment by Jan Lindström (Inactive) [ 2019-05-21 ] |
|
https://github.com/MariaDB/server/pull/1305 should fix this also. |
| Comment by Marko Mäkelä [ 2019-05-21 ] |
|
I do not think that |
| Comment by Jan Lindström (Inactive) [ 2019-05-21 ] |
|
sciascid Can you please check 10.1 and 10.2 case and is there still something needed for 10.3->10.4 |
| Comment by Daniele Sciascia [ 2019-05-23 ] |
|
GeoffMontee This is not a bug. Option --wsrep-new-cluster simply signals galera that the starting node is alone in the cluster, and will bootstrap. What you are doing in your examples above, falls in the second case: you are basically restarting the first node of your cluster. And because the cluster existed, its old state is preserved. There currently is no option to reset galera state. As you mentioned, you can manually delete the old state in the datadir. |
| Comment by Geoff Montee (Inactive) [ 2019-05-23 ] |
|
Thanks, sciascid. I expected this was the case. I think the new cluster in the --wsrep-new-cluster option name and the galera_new_cluster script name is a bit of a misnomer then. In hindsight, they probably should have been called something like --wsrep-bootstrap-cluster and galera_boostrap_cluster. But it probably doesn't matter. |