Skip to content

Move clusterDelNode and clusterRenameNode to cluster_state.c#3542

Draft
zuiderkwast wants to merge 1 commit intovalkey-io:cluster-v2from
zuiderkwast:fix-clusterDelNode
Draft

Move clusterDelNode and clusterRenameNode to cluster_state.c#3542
zuiderkwast wants to merge 1 commit intovalkey-io:cluster-v2from
zuiderkwast:fix-clusterDelNode

Conversation

@zuiderkwast
Copy link
Copy Markdown
Contributor

clusterDelNode was defined in cluster_legacy.c but declared in the shared cluster_state.h header, making it callable from any protocol implementation despite containing gossip-specific logic (failure report removal via rax iteration).

Extract the gossip-specific cleanup into a cleanupNode callback on the bus vtable. Move the common parts (slot cleanup, shard removal, freeClusterNode) and clusterRenameNode to cluster_state.c where they belong as protocol-independent operations.

This code was written by @murphyjacob4 and is part of #3532. The code was extracted from the PR as-is, so it shouldn't get any merge conflicts. (I removed a stale comment and a stale forward declaration though.)

clusterDelNode was defined in cluster_legacy.c but declared in the
shared cluster_state.h header, making it callable from any protocol
implementation despite containing gossip-specific logic (failure
report removal via rax iteration).

Extract the gossip-specific cleanup into a cleanupNode callback on
the bus vtable. Move the common parts (slot cleanup, shard removal,
freeClusterNode) and clusterRenameNode to cluster_state.c where they
belong as protocol-independent operations.

Co-authored-by: Jacob Murphy <jkmurphy@google.com>
Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.53%. Comparing base (6b93134) to head (36cfd44).

Additional details and impacted files
@@              Coverage Diff               @@
##           cluster-v2    #3542      +/-   ##
==============================================
- Coverage       76.59%   76.53%   -0.07%     
==============================================
  Files             160      160              
  Lines           79288    79292       +4     
==============================================
- Hits            60733    60688      -45     
- Misses          18555    18604      +49     
Files with missing lines Coverage Δ
src/cluster_legacy.c 92.11% <100.00%> (+0.36%) ⬆️
src/cluster_state.c 88.74% <100.00%> (+0.63%) ⬆️

... and 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant