fix: resolve Shake client hang in HandShaking state due to source Redis blocking during AofRewrite (#882)

This commit is contained in:
EquentR 2024-11-15 13:47:50 +08:00 committed by GitHub
parent ce3c544170
commit 6086d1de7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ func (r *syncStandaloneReader) checkBgsaveInProgress() {
argv := []interface{}{"INFO", "persistence"}
r.client.Send(argv...)
receiveString := r.client.ReceiveString()
if strings.Contains(receiveString, "rdb_bgsave_in_progress:1") {
if strings.Contains(receiveString, "rdb_bgsave_in_progress:1") || strings.Contains(receiveString, "aof_rewrite_in_progress:1") {
log.Warnf("[%s] source db is doing bgsave, waiting for a while.", r.stat.Name)
} else {
log.Infof("[%s] source db is not doing bgsave! continue.", r.stat.Name)