ahn heesuk
05/12/2026, 2:35 AMRocky
05/12/2026, 2:35 AMCREATE TABLE, ALTER TABLE, or even the internal commits for data loading) must be acknowledged by a majority of the Follower nodes. With 5 nodes, the Leader must wait for more network acknowledgments, which can slightly increase the latency of these operations.
* Inter-node Communication: The synchronization of the edit log across more nodes increases the internal network traffic among FEs, though this is usually negligible unless your cluster has a very high frequency of schema changes or small-batch loads.
* Complexity: Managing more stateful nodes increases the maintenance overhead.
3. Best Practices for FE Node Count
For most production environments, the recommended path is:
* Standard HA (3 Followers): Deploy 3 Follower nodes. This is the "sweet spot" for metadata reliability and performance.
* High Read Concurrency (Observers): If your goal is to handle thousands of concurrent query requests rather than improving fault tolerance, do not add more Followers. Instead, add Observer FE nodes.
* Followers: Participate in voting and the write quorum.
* Observers: Synchronize logs asynchronously and only handle read requests. They do not increase the write quorum, so they don't slow down the leader.
* The "Odd Number" Rule: Always maintain an odd number of Follower nodes (1, 3, or 5) to avoid split-brain scenarios and maximize the fault tolerance for the number of nodes used.
4. Real-World Usage
* 3 nodes: Used by >90% of StarRocks users. It protects against a single rack or node failure, which is the most common failure mode.
* 5 nodes: Typically only used in extreme scenarios, such as multi-region deployments or very large clusters where the cost of a full cluster restart (due to losing quorum) is exceptionally high and the infrastructure allows for two independent failures.
Summary Recommendation
* Stick with 3 nodes if your primary concern is standard high availability. Double-node failures are rare enough that the performance and simplicity of 3 nodes usually outweigh the benefits of 5.
* Upgrade to 5 nodes only if your business requirements strictly mandate survival during a 2-node simultaneous outage (e.g., a "two-rack failure" scenario).
* Use Observers if you are seeing high CPU usage on your 3 FE nodes due to query traffic.
References
• deployment/deploy_manually.md
• faq/Deploy_faq.md
• deployment/plan_cluster.mdRocky
05/12/2026, 2:39 AMpartition.getVisibleVersion() + 1 != version.get(0) indicates a gap or overlap in the metadata versioning for a specific partition.
* Visible Version + 1: This is the version the FE expects to commit next.
* version.get(0): This is the version of the data batch currently being published.
* In your case (75807 75807): The FE expects the next version to be 75808 (75807 + 1), but the batch it is trying to publish claims to be version 75807. Since 75807 has likely already been committed or is out of order, the FE rejects it to prevent metadata corruption.
2. Why the FE CPU is Spiking
The CPU spike is usually caused by:
* Log Flooding: The PublishVersionDaemon runs in a tight loop. When a publish task fails, it retries frequently, generating a massive volume of "ERROR" logs. Writing these logs to disk and managing the internal retry queue consumes significant CPU.
* Metadata Contention: When lake_enable_batch_publish_version is on, the FE Leader has to group multiple transaction logs and coordinate their commit. If there is a race condition (often caused by concurrent Schema Changes or high-frequency small-batch imports), the FE spends excessive cycles trying to resolve the versioning conflicts.
3. Immediate Recommended Actions
This is a known issue in some versions (notably 3.3.x and early 3.4.x) when using the batch publish optimization.
1. Disable Batch Publishing: Since you mentioned "turning it back on" triggered the spike, the most immediate fix is to revert that setting to stop the loop:
sql
ADMIN SET FRONTEND CONFIG ("lake_enable_batch_publish_version" = "false");
Note: This might cause a temporary increase in the number of versions if you have high-frequency writes, but it will stop the error loop.
2. Check for Stuck Transactions: Look for transactions that are stuck in the "PREPARED" or "COMMITTED" state but haven't been "VISIBLE":
sql
SHOW PROC '/transactions';
If you see very old transactions for the DB/Table ID mentioned in your logs (32988495), they may be blocking the version sequence.
3. Check for Schema Changes: This error is frequently triggered if a SCHEMA CHANGE (ALTER TABLE) was running while batching was enabled. Check if any jobs are stuck:
sql
SHOW ALTER TABLE COLUMN;
4. Long-term Fix
This behavior was identified as a bug in the shared-data version management logic (specifically regarding how the FE handles the transition between individual and batch publishing).
* Upgrade: Ensure you are on the latest patch release of your major version (e.g., 3.3.7+, 3.4.1+), as several fixes for PublishVersionDaemon race conditions were introduced in late 2024 and 2025.
* Consolidate Loads: If your FE is struggling with versions, consider increasing the amount of data per load (batching at the source) rather than relying on the FE-side lake_enable_batch_publish_version to group thousands of tiny transactions.
If the CPU remains high after disabling the config, you may need to restart the FE Leader to clear the pending task queue.