-
Notifications
You must be signed in to change notification settings - Fork 264
fix: Publisher-mode synchronization option for failover scenario #3222
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
954a74a
Publisher-mode synchronization option for failover scenario
alpe 74641e0
Changelog
alpe 53f5ded
Review feedback
alpe a2607e5
Doc update
alpe 1b8da2e
Merge branch 'main' into alex/sync_race
julienrbrt 0f55e6a
Merge branch 'main' into alex/sync_race
julienrbrt 5218cc6
just tidy all
julienrbrt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ This guide details the Raft consensus implementation in `ev-node`, used for High | |
|
|
||
| ## Configuration | ||
|
|
||
| Raft is configured via CLI flags or the `config.toml` file under the `[raft]` (or `[rollkit.raft]`) section. | ||
| Raft is configured via CLI flags or the `config.toml` file under the `[raft]` (or `[evnode.raft]`) section. | ||
|
|
||
| ### Essential Flags | ||
|
|
||
|
|
@@ -33,7 +33,7 @@ Raft is configured via CLI flags or the `config.toml` file under the `[raft]` (o | |
| | `--evnode.raft.raft_addr` | `raft.raft_addr` | TCP address for Raft transport. | `0.0.0.0:5001` (Bind to private IP) | | ||
| | `--evnode.raft.raft_dir` | `raft.raft_dir` | Directory for Raft data. | `/data/raft` (Must be persistent) | | ||
| | `--evnode.raft.peers` | `raft.peers` | Comma-separated list of peer addresses in format `nodeID@host:port`. | `[email protected]:5001,[email protected]:5001,[email protected]:5001` | | ||
| | `--evnode.raft.bootstrap` | `raft.bootstrap` | Bootstrap the cluster. **Required** for initial setup. | `true` (See Limitations) | | ||
| | `--evnode.raft.bootstrap` | `raft.bootstrap` | Compatibility flag. Startup mode is selected automatically from persisted raft configuration state. | optional | | ||
|
|
||
| ### Timeout Tuning | ||
|
|
||
|
|
@@ -55,11 +55,15 @@ Ideally, a failover should complete within `2 * BlockTime` to minimize user impa | |
|
|
||
| ## Production Deployment Principles | ||
|
|
||
| ### 1. Static Peering & Bootstrap | ||
| Current implementation requires **Bootstrap Mode** (`--evnode.raft.bootstrap=true`) for all nodes participating in the cluster initialization. | ||
| * **All nodes** should list the full set of peers in `--evnode.raft.peers`. | ||
| ### 1. Static Peering & Automatic Startup Mode | ||
| Use static peering with automatic mode selection from local raft configuration: | ||
| * If local raft configuration already exists in `--evnode.raft.raft_dir`, the node starts in rejoin mode. | ||
| * If no local raft configuration exists yet, the node bootstraps from configured peers. | ||
| * `--evnode.raft.bootstrap` is retained for compatibility but does not control mode selection. | ||
| * **All configured cluster members** should list the full set of peers in `--evnode.raft.peers`. | ||
| * The `peers` list format is strict: `NodeID@Host:Port`. | ||
| * **Limitation**: Dynamic addition of peers (Run-time Membership Changes) via RPC/CLI is not currently exposed. The cluster membership is static based on the initial bootstrap configuration. | ||
| * **Limitation**: Dynamic addition of peers (run-time membership changes) via RPC/CLI is not currently exposed. | ||
| * **Not supported**: Joining an existing cluster as a brand-new node that was not part of the initial static membership. | ||
|
|
||
| ### 2. Infrastructure Requirements | ||
| * **Encrypted Network (CRITICAL)**: Raft traffic is **unencrypted** (plain TCP). You **MUST** run the cluster inside a private network, VPN, or encrypted mesh (e.g., WireGuard, Tailscale). **Never expose Raft ports to the public internet**; doing so allows attackers to hijack the cluster consensus. | ||
|
|
@@ -86,13 +90,13 @@ Monitor the following metrics (propagated via Prometheus if enabled): | |
|
|
||
| ```bash | ||
| ./ev-node start \ | ||
| --node.aggregator \ | ||
| --raft.enable \ | ||
| --raft.node_id="node-1" \ | ||
| --raft.raft_addr="0.0.0.0:5001" \ | ||
| --raft.raft_dir="/var/lib/ev-node/raft" \ | ||
| --raft.bootstrap=true \ | ||
| --raft.peers="[email protected]:5001,[email protected]:5001,[email protected]:5001" \ | ||
| --p2p.listen_address="/ip4/0.0.0.0/tcp/26656" \ | ||
| --evnode.node.aggregator=true \ | ||
| --evnode.raft.enable=true \ | ||
| --evnode.raft.node_id="node-1" \ | ||
| --evnode.raft.raft_addr="0.0.0.0:5001" \ | ||
| --evnode.raft.raft_dir="/var/lib/ev-node/raft" \ | ||
| --evnode.raft.bootstrap=true \ | ||
| --evnode.raft.peers="[email protected]:5001,[email protected]:5001,[email protected]:5001" \ | ||
| --evnode.p2p.listen_address="/ip4/0.0.0.0/tcp/26656" \ | ||
| ...other flags | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is effectivelly to use the correct state when we override it at L1207 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, before it was re-read in the method and could be empty