Skip to content

fix: do not voluntarily relinquish the replication lock#1211

Merged
GabrielePicco merged 3 commits into
masterfrom
bmuddha/replicator/disable-voluntary-relinquishment
May 20, 2026
Merged

fix: do not voluntarily relinquish the replication lock#1211
GabrielePicco merged 3 commits into
masterfrom
bmuddha/replicator/disable-voluntary-relinquishment

Conversation

@bmuddha
Copy link
Copy Markdown
Collaborator

@bmuddha bmuddha commented May 18, 2026

This PR disables automatic relinquishment of replication lock by primary node, which should allow the leader to perform quick restart without failover to other standby nodes.

Summary by CodeRabbit

  • Chores
    • Increased lock and API timeout durations to 15 seconds to reduce premature timeouts and give operations more time to complete.
    • Simplified primary replication shutdown flow by removing explicit lock release on shutdown, yielding cleaner and more predictable termination behavior.

Review Change Stack

@bmuddha bmuddha self-assigned this May 18, 2026
@bmuddha bmuddha force-pushed the bmuddha/replicator/disable-voluntary-relinquishment branch from 443caa3 to 5dab8f9 Compare May 18, 2026 09:54
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c31dd456-f603-4f0b-96d7-49ff79a52a60

📥 Commits

Reviewing files that changed from the base of the PR and between 67b21c2 and 6f86983.

📒 Files selected for processing (1)
  • magicblock-replicator/src/nats/mod.rs

📝 Walkthrough

Walkthrough

This PR increases three timeouts: NATS JetStream TTL_LOCK from 5s to 15s, NATS API_TIMEOUT from 2s to 5s, and the replicator LEADER_TIMEOUT from 5s to 15s. In the primary replication loop, the cancellation branch no longer calls producer.release().await; it logs that shutdown was received and returns Ok(None) to exit primary mode.

Suggested reviewers

  • GabrielePicco
  • snawaz
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bmuddha/replicator/disable-voluntary-relinquishment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Collaborator

@GabrielePicco GabrielePicco left a comment

Choose a reason for hiding this comment

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

LGTM!

@GabrielePicco GabrielePicco merged commit 577a4cb into master May 20, 2026
33 checks passed
@GabrielePicco GabrielePicco deleted the bmuddha/replicator/disable-voluntary-relinquishment branch May 20, 2026 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