kvrocks-controller icon indicating copy to clipboard operation
kvrocks-controller copied to clipboard

Failover failed because of sequence is 0

Open ninuxer opened this issue 1 month ago • 3 comments

#340 is good, but when an instance has never had any data written to it (so its sequence number is 0), performing a failover operation will fail.

ninuxer avatar Nov 19 '25 05:11 ninuxer

@ninuxer Yes, perhaps we could provide a switch to disable this restriction.

git-hulk avatar Nov 19 '25 05:11 git-hulk

@git-hulk Could we retrieve the sequence of the master node within the store/cluster_shard.go: getNewMasterNodeIndex function? If the master's sequence is also 0, it means that no data has ever been written to this shard, and in this case, we can skip the validation of the slave node's sequence is 0.

ninuxer avatar Nov 19 '25 08:11 ninuxer

@ninuxer It's a good way to avoid this situation when the master is still alive.

git-hulk avatar Nov 19 '25 11:11 git-hulk