Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql 从节点重建失败,无法同步数据 #845

Open
crazychengmm opened this issue May 15, 2024 · 2 comments
Open

Mysql 从节点重建失败,无法同步数据 #845

crazychengmm opened this issue May 15, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@crazychengmm
Copy link

Describe the problem

operator:
/mysql-operator/radondb/mysql57-sidecar:v2.3.0
Mysql
/mysql-operator/percona/percona-server:5.7.34


从节点出现报错信息

[ERROR] Error reading packet from server for channel '': The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires. Replicate the missing transactions from elsewhere, or provision a new slave from backup. Consider increasing the master's binary log expiration period. The GTID set sent by the slave is '', and the missing transactions are 'a84655cf-71a2-11ee-aec3-7a94179244c7:1-22314,

Wed, May 15 2024 7:39:27 pm | bc7a6e13-73c6-11ee-a3f3-2a79e19dc85a:1-12141'. (server_errno=1236)
Wed, May 15 2024 7:39:27 pm | 2024-05-15T19:39:27.326592+08:00 6943 [ERROR] Slave I/O for channel '': Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires. Replicate the missing transactions from elsewhere, or provision a new slave from backup. Consider increasing the master's binary log expiration period. The GTID set sent by the slave is '', and the missing transactions are 'a84655cf-71a2-11ee-aec3-7a94179244c7:1-22314,
Wed, May 15 2024 7:39:27 pm | bc7a6e13-73c6-11ee-a3f3-2a79e19dc85a:1-12141'.', Error_code: 1236

从错误看是,从去同步发现文件已经找不到了,我设置的文件保留7天的,理论上不会出现这样的问题。

主报错:

[Warning] Cannot replicate to server with server_uuid='55ccb968-12a9-11ef-bfab-0a9a5494a1a9' because the present server has purged required binary logs. The connecting server needs to replicate the missing transactions from elsewhere, or be replaced by a new server created from a more recent backup. To prevent this error in the future, consider increasing the binary log expiration period on the present server. The missing transactions are 'a84655cf-71a2-11ee-aec3-7a94179244c7:1-22314,

Wed, May 15 2024 7:47:05 pm | bc7a6e13-73c6-11ee-a3f3-2a79e19dc85a:1-12141'.
Wed, May 15 2024 7:47:05 pm | 2024-05-15T19:47:05.535880+08:00 8862 [Warning] Cannot replicate to server with server_uuid='71603b88-129f-11ef-8cd2-5e29023cab45' because the present server has purged required binary logs. The connecting server needs to replicate the missing transactions from elsewhere, or be replaced by a new server created from a more recent backup. To prevent this error in the future, consider increasing the binary log expiration period on the present server. The missing transactions are 'a84655cf-71a2-11ee-aec3-7a94179244c7:1-22314,
Wed, May 15 2024 7:47:05 pm | bc7a6e13-73c6-11ee-a3f3-2a79e19dc85a:1-12141'.

To Reproduce

于是我去重建 从节点,但是从备份还原,还是去通过老的gtid 同步数据了,所以一直是老的问题。
这样,最新备份应该是没有做导致,还原不能去读最新的备份,请教下如何解决啊

Expected behavior

Environment:

  • RadonDB MySQL version:
@crazychengmm crazychengmm added the bug Something isn't working label May 15, 2024
@crazychengmm
Copy link
Author

比较尴尬的是,两个从节点都出问题了,主节点,一直处于Waiting for semi-sync ACK from slave 状态。
这样其他的操作都被锁住了

@crazychengmm
Copy link
Author

crazychengmm commented May 16, 2024

看了代码是

	if len(serviceURL) == 0 && CheckServiceExist(cfg, "follower") {
		serviceURL = fmt.Sprintf("http://%s-%s:%v", cfg.ClusterName, "follower", utils.XBackupPort)
		server = fmt.Sprintf("%s-%s", cfg.ClusterName, "follower")
	}
	//check leader is exist?
	if len(serviceURL) == 0 && CheckServiceExist(cfg, "leader") {
		serviceURL = fmt.Sprintf("http://%s-%s:%v", cfg.ClusterName, "leader", utils.XBackupPort)
		server = fmt.Sprintf("%s-%s", cfg.ClusterName, "leader")
	}

优先去读从库的,从库数据库出现问题的话,也还是去读从库,做成配置项更好点,这个如何解决呀,求指导 @acekingke @KID-G 感谢大佬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant