colinmollenhour / mariadb-galera-swarm

MariaDb Galera Cluster container based on official mariadb image which can auto-bootstrap and recover cluster state.
https://hub.docker.com/r/colinmollenhour/mariadb-galera-swarm
Apache License 2.0
216 stars 101 forks source link

how to force recovery? #107

Closed bonafideyan closed 2 years ago

bonafideyan commented 2 years ago

After some failure and redeploy, the mariadb cluster in swarm still works, but there two nodes whose logs has error:

2021-10-30  8:31:06 578 [ERROR] InnoDB: Page [page id: space=387, page number=5] log sequence number 32799366 is in the future! Current system log sequence number 20966389.
2021-10-30  8:31:06 578 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.

if it is not in production environment, I will remove all volume about db and create the cluster then import the backuped db data.

now I don't know how to recovery it really, enter the container, modify the the config to recovery_mode=1, then restart the mysql process in container manullay, can I do this way?

colinmollenhour commented 2 years ago

I think that message may mean that the node that was redeployed has data that wasn't fully committed to the other nodes so it is "newer".. You could start that node with /var/lib/mysql/new-cluster flag file so it would become the primary node then stop all other nodes then restart them to rejoin the new cluster automatically.