Skip to content

Implement node status synchronization in Controller, including downtime notifications and online/offline management#388

Merged
git-hulk merged 4 commits intoapache:unstablefrom
Paragrf:ha
Apr 24, 2026
Merged

Implement node status synchronization in Controller, including downtime notifications and online/offline management#388
git-hulk merged 4 commits intoapache:unstablefrom
Paragrf:ha

Conversation

@Paragrf
Copy link
Copy Markdown
Contributor

@Paragrf Paragrf commented Apr 10, 2026

Background
To improve cluster reliability and operational efficiency, the controller needs to bridge the status gap between slave nodes and the server. Beyond just reporting unexpected failures, it is essential to support proactive maintenance workflows, allowing operators to safely remove traffic before performing node updates or hardware swaps.

Key Changes

  • Downtime Push: The controller now monitors slave node health and proactively pushes "Downtime" alerts to the server upon detection of a crash or heartbeat timeout.

  • Manual Offline (Traffic Draining): Supports a proactive "Offline" command. This allows the server to drain/stop traffic to a specific slave node before any maintenance work begins, ensuring zero-impact operations.

  • Manual Online: Supports a "Ready-to-Serve" notification when a slave is back online and fully synchronized, allowing the server to safely re-enable traffic.

Related Issues
Fixes #385

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 77.27273% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.17%. Comparing base (6c56470) to head (cc055b5).
⚠️ Report is 106 commits behind head on unstable.

Files with missing lines Patch % Lines
controller/cluster.go 59.25% 7 Missing and 4 partials ⚠️
store/cluster_node.go 67.74% 10 Missing ⚠️
server/api/node.go 73.91% 4 Missing and 2 partials ⚠️
server/helper/helper.go 0.00% 2 Missing ⚠️
server/route.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #388      +/-   ##
============================================
+ Coverage     43.38%   50.17%   +6.79%     
============================================
  Files            37       45       +8     
  Lines          2971     3906     +935     
============================================
+ Hits           1289     1960     +671     
- Misses         1544     1732     +188     
- Partials        138      214      +76     
Flag Coverage Δ
unittests 50.17% <77.27%> (+6.79%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@git-hulk git-hulk self-requested a review April 10, 2026 06:50
Comment thread consts/errors.go
Comment thread store/cluster_node.go Outdated
Comment thread store/cluster.go Outdated
Comment thread store/cluster.go Outdated
@git-hulk
Copy link
Copy Markdown
Member

@Paragrf Sorry for the late review due to the heavy traffic at work.

@Paragrf Paragrf force-pushed the ha branch 2 times, most recently from dc2de98 to 87937e4 Compare April 23, 2026 07:35
@Paragrf
Copy link
Copy Markdown
Contributor Author

Paragrf commented Apr 23, 2026

@git-hulk Internal interfaces now support more node states, but external online/offline APIs remain backward compatible with original semantics.

Comment thread store/cluster_shard.go
Comment thread store/cluster_node.go Outdated
@Paragrf
Copy link
Copy Markdown
Contributor Author

Paragrf commented Apr 24, 2026

Added a configuration option where HA does not modify the status of failed slave nodes by default, ensuring backward compatibility with legacy Kvrocks.

@git-hulk git-hulk merged commit ae16132 into apache:unstable Apr 24, 2026
2 checks passed
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.

Broadcast the replica downtime to surviving nodes, allowing Redis clients to refresh their topology and drain traffic from the offline node.

3 participants