Repository navigation
Fix replica left as a sub-replica after a failover - #486
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#485
假设主从关系是:A1->A2, A1->A3,对A3执行cluster failover提主后,期望主从关系变成A3->A1,A3->A2。
但是当前代码可能出现下面的错误情况:A3->A1->A2,A2节点依旧挂在A1后面,没有挂到A3后面去。
出现的前提是:
A2先收到A1变从的消息,后收到A3持有slots的信息。
出错的原因是:
A2先收到A1变从的消息时,执行clusterDelNodeSlots。然后收到A3持有slots的信息,在执行clusterUpdateSlotsConfigWith时,_allSlots[j]和curmaster对不上,所以不会进行切换主节点。
特别是 #482 这个修复之后,会在旧主A1降级为从时立刻广播pong,从而更容易触发“A2先收到A1变从的消息,后收到A3持有slots的信息。”
Description
Motivation and Context
How Has This Been Tested?
Types of Changes
Checklist: