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

Fix the election was reset wrongly before failover epoch was obtained #1339

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

enjoy-binbin
Copy link
Member

After #1009, we will reset the election when we received
a claim with an equal or higher epoch since a node can win
an election in the past.

But we need to consider the time before the node actually
obtains the failover_auth_epoch. The failover_auth_epoch
default is 0, so before the node actually get the failover
epoch, we might wrongly reset the election.

This is probably harmless, but will produce misleading log
output and may delay election by a cron cycle or beforesleep.
Now we will only reset the election when a node is actually
obtains the failover epoch.

After valkey-io#1009, we will reset the election when we received
a claim with an equal or higher epoch since a node can win
an election in the past.

But we need to consider the time before the node actually
obtains the failover_auth_epoch. The failover_auth_epoch
default is 0, so before the node actually get the failover
epoch, we might wrongly reset the election.

This is probably harmless, but will produce misleading log
output and may delay election by a cron cycle or beforesleep.
Now we will only reset the election when a node is actually
obtains the failover epoch.

Signed-off-by: Binbin <[email protected]>
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.61%. Comparing base (50aae13) to head (c2d5d61).
Report is 40 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1339      +/-   ##
============================================
- Coverage     70.76%   70.61%   -0.16%     
============================================
  Files           116      116              
  Lines         63271    63281      +10     
============================================
- Hits          44776    44688      -88     
- Misses        18495    18593      +98     
Files with missing lines Coverage Δ
src/cluster_legacy.c 86.30% <100.00%> (-0.22%) ⬇️

... and 14 files with indirect coverage changes

src/cluster_legacy.c Show resolved Hide resolved
@enjoy-binbin enjoy-binbin merged commit 924729e into valkey-io:unstable Dec 9, 2024
48 checks passed
@enjoy-binbin enjoy-binbin deleted the fix_false_epoch_0 branch December 9, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants