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 empty primary may have dirty slots data due to bad migration #1285

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

enjoy-binbin
Copy link
Member

If we become an empty primary for some reason, we still need to
check if we need to delete dirty slots, because we may have dirty
slots data left over from a bad migration. Like the target node
forcibly executes CLUSTER SETSLOT NODE to take over the slot without
performing key migration.

If we become an empty primary for some reason, we still need to
check if we need to delete dirty slots, because we may have dirty
slots data left over from a bad migration. Like the target node
forcibly executes CLUSTER SETSLOT NODE to take over the slot without
performing key migration.

Signed-off-by: Binbin <[email protected]>
@enjoy-binbin enjoy-binbin requested review from PingXie and zuiderkwast and removed request for PingXie November 9, 2024 16:01
Copy link

codecov bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.52%. Comparing base (e972d56) to head (93f7268).
Report is 7 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1285      +/-   ##
============================================
- Coverage     70.70%   70.52%   -0.19%     
============================================
  Files           114      114              
  Lines         63147    63149       +2     
============================================
- Hits          44648    44533     -115     
- Misses        18499    18616     +117     
Files with missing lines Coverage Δ
src/cluster_legacy.c 86.29% <100.00%> (+0.07%) ⬆️

... and 15 files with indirect coverage changes

Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another corner case covered. Nice!

@zuiderkwast zuiderkwast added the release-notes This issue should get a line item in the release notes label Nov 9, 2024
@enjoy-binbin enjoy-binbin merged commit 2df56d8 into valkey-io:unstable Nov 11, 2024
48 checks passed
@enjoy-binbin enjoy-binbin deleted the fix_empty_primary branch November 11, 2024 14:13
zvi-code pushed a commit to zvi-code/valkey-z that referenced this pull request Nov 13, 2024
…key-io#1285)

If we become an empty primary for some reason, we still need to
check if we need to delete dirty slots, because we may have dirty
slots data left over from a bad migration. Like the target node forcibly
executes CLUSTER SETSLOT NODE to take over the slot without
performing key migration.

Signed-off-by: Binbin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes This issue should get a line item in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants