Add per-direction cluster link established counter info fields#4169
Add per-direction cluster link established counter info fields#4169enjoy-binbin wants to merge 2 commits into
Conversation
Expose two new CLUSTER INFO counters to track cluster link: - total_cluster_links_established_inbound: inbound links successfully established with peers via accept - total_cluster_links_established_outbound: outbound links successfully established to peers via connect Unlike the existing topology-derived cluster_connections field, these are precise cumulative counters incremented when a link is actually established (on accept, and on successful connect). They help surface network flapping / frequent re-connections between nodes. Both fields can be reset by CONFIG RESETSTAT. Signed-off-by: Binbin <binloveplay1314@qq.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughCluster link statistics now count successfully established inbound and outbound connections, expose both totals in cluster info, reset them with cluster statistics, and validate startup and reset behavior in unit tests. ChangesCluster Link Statistics
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant ClusterPeer
participant ClusterHandlers
participant clusterState
participant ClusterInfo
ClusterPeer->>ClusterHandlers: establish inbound or outbound link
ClusterHandlers->>clusterState: increment corresponding counter
ClusterInfo->>clusterState: read establishment totals
clusterState-->>ClusterInfo: inbound and outbound totals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/unit/cluster/info.tcl`:
- Around line 64-65: Update the second assertion in the cluster link checks to
validate node 2’s inbound counter instead of repeating
total_cluster_links_established_outbound, while preserving the existing
threshold and outbound assertion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9e99d1ea-5519-4a6d-8e33-33dddc0e2fd4
📒 Files selected for processing (4)
src/cluster.csrc/cluster_legacy.csrc/cluster_legacy.htests/unit/cluster/info.tcl
Signed-off-by: Binbin <binloveplay1314@qq.com>
Expose two new CLUSTER INFO counters to track cluster link:
successfully established with peers via accept
successfully established to peers via connect
Unlike the existing topology-derived cluster_connections field,
these are precise cumulative counters incremented when a link
is actually established (on accept, and on successful connect).
They help surface network flapping / frequent re-connections
between nodes.