GregM
10/06/2026, 2:24 PMRocky
10/06/2026, 2:24 PMINSERT immediately after the first one completes is a common pattern for batch ETL, but it can lead to instability if the batch size is too small and the frequency is too high.
1. Does it cause instability?
Not inherently, but it can trigger StarRocks' self-protection mechanisms if compaction cannot keep up with the version creation rate.
* Version Creation: Every INSERT INTO ... SELECT creates a new version of the data. Primary Key (PK) tables have higher overhead than Duplicate Key tables because each version requires updating the primary key index and generating Delete Vectors.
* Compaction Score: If you trigger many small inserts in rapid succession, the "compaction score" of the tablets will rise.
* Ingestion Slowdown: In shared-data clusters, if the compaction score exceeds a threshold (typically 100), StarRocks will deliberately delay the commit of the next insert to allow compaction to catch up. This may manifest as the second insert taking much longer than the first.
* Write Failure: If the score continues to rise beyond the limit, the ingestion will eventually fail with an error like: Failed to load data ... because of too large compaction score.
2. Best Practices for Batch ETL (Duplicate Key to PK)
To ensure stability and performance when moving data from a staging (Duplicate Key) table to a PK table, follow these recommendations:
A. Optimize Batch Size and Frequency
* Prefer "Large and Few" over "Small and Many": Instead of running an ETL every minute with 10k rows, aim for larger batches (e.g., every 5–10 minutes or larger row counts). Larger batches reduce the number of versions and make compaction more efficient.
* Monitor Versioning: Check the health of your partitions using:
sql
SHOW PROC '/transactions/<db_name>/running';
Look at the ErrMsg field. If you see Partition's compaction score is larger than 100.0, delay commit, it is a sign you should increase your batch size or reduce frequency.
B. Tuning for Shared-Data Compaction
If your business requirements necessitate high-frequency inserts, you can tune the cluster to handle compaction more aggressively:
* FE Configuration: Increase the maximum concurrent compaction tasks across the cluster:
sql
ADMIN SET FRONTEND CONFIG ("lake_compaction_max_tasks" = "-1"); -- -1 is adaptive (CN count * 16)
* CN Configuration: Increase the threads dedicated to compaction on the Compute Nodes (usually set to 25% of CPU cores):
sql
UPDATE information_schema.be_configs SET VALUE = "8" WHERE name = "compact_threads";
C. Primary Key Specific Optimizations
* Persistent Index: Ensure the Primary Key index is persistent (default in newer 3.x versions) to avoid memory pressure during large ETL runs.
* Partial Updates: If your ETL only updates a subset of columns, use the partial_update session variable to reduce I/O:
sql
SET partial_update_mode = 'column'; -- For v3.3+
INSERT INTO pk_table SELECT ... FROM staging_table;
Summary
Starting the next insert immediately is fine as long as your compaction resource is sufficient for the data volume per insert. If you notice "delayed commits" or "too many versions" errors, the best fix is to increase the amount of data per INSERT statement.
References
• loading/InsertInto.md
• loading/loading_introduction/troubleshooting_loading.mdGregM
10/06/2026, 2:28 PMGregM
10/06/2026, 2:28 PMFail to publish partition 6108344 error Fail to publish version for tablets:[], error msg: link rpc channel failed, host: kube-starrocks-cn-1.
Rocky
10/06/2026, 2:28 PMerrorCode=62 errorMessage:method request time out with a onceTalkTimeout of 60,000ms is an internal RPC timeout between the StarRocks Frontend (FE) and Compute Nodes (CN/BE).
In your scenario—inserting into a *Primary Key (PK) table*—this specifically happens during the Publish Version phase. After the data is written, the FE sends a request to the CNs to commit the transaction. For PK tables, the CN must finish "applying" the data (updating the primary key index and delete vectors) before it can respond. If this "apply" process takes longer than 60 seconds (usually due to high disk I/O, large batches, or CPU saturation), the FE gives up and throws this error.
How to Resolve This
1. Increase the Publish Timeout (Immediate Fix)
You can increase the time the FE waits for the CN to finish the publish/apply phase.
* Parameter: tablet_publish_timeout_second
* Action: Increase this from the default (typically 60s) to a higher value like 120 or 300.
sql
-- Run this on the FE
ADMIN SET FRONTEND CONFIG ("tablet_publish_timeout_second" = "300");
2. Address the "Apply" Bottleneck
If the apply phase is consistently exceeding 60 seconds, your CNs are likely struggling to keep up with the metadata overhead of the PK table.
* Check Disk I/O: Since you are in a shared-data architecture, check the I/O and CPU of your CN nodes. High "Wait IO" often slows down the PK index updates.
* Persistent Index: Ensure the PK table is using a Persistent Index. If the index is only in memory and the memory is tight, it will trigger frequent swaps or loading from disk, causing massive delays.
* Check table properties: SHOW CREATE TABLE <table_name>;
* Look for "enable_persistent_index" = "true".
* Reduce Concurrency: You mentioned starting the next insert immediately. If the previous insert's "apply" or "compaction" tasks are still consuming resources, the next insert will be slower. Try adding a small delay (e.g., 5-10 seconds) or increasing the size of each batch so you run fewer, larger inserts.
3. Monitor "Blacklisted" Backends
When this RPC timeout occurs, the FE may temporarily mark a CN as "dead" or "blacklisted" because it failed to respond. This can lead to subsequent "Backend not found" or "No alive backend" errors.
* Monitor the status with: SHOW BACKENDS; (or SHOW COMPUTE NODES; in shared-data).
* If they are Alive: false, check the fe.log to see if they were blacklisted due to the timeout.
Summary
The instability is caused by the commit phase taking longer than the default 60s RPC timeout. To fix it, increase tablet_publish_timeout_second to 300 and ensure your Primary Key tables are using persistent_index to handle the metadata load more efficiently.
References
• loading/InsertInto.md
• administration/management/FE_configuration.md
• table_design/table_types/primary_key_table.md
References
• faq/Sql_faq.md
• administration/Meta_recovery.md
• faq/loading/Broker_load_faq.md
• knowledge/trouble_shooting/fe_deadlock_problems.md
• administration/management/FE_configuration.md
• administration/management/BE_configuration.mdRocky
10/06/2026, 2:29 PMFail to publish version ... error msg: link rpc channel failed, host: kube-starrocks-cn-1 indicates a network communication failure between the FE (Frontend) and a CN (Compute Node) during the final stage of your INSERT transaction.
In StarRocks, "Publishing Version" is the process where the FE notifies the nodes that the data is now committed and visible. A "link rpc channel failed" error means the FE's attempt to connect to the CN's RPC port (default 9060) was refused or timed out at the network level.
Given your "tight loop" ETL pattern, here are the most likely causes and how to fix them:
1. CN Node Instability (OOM or Restarts)
Because you are inserting into a Primary Key table, the CN node performs extra work (calculating the primary key index and delete vectors).
* What's happening: The high frequency of inserts might be causing the CN pod (kube-starrocks-cn-1) to run out of memory (OOM) or hit CPU limits, causing it to restart or become unresponsive.
* Action: Run kubectl get pods and check the RESTARTS column for your CN pods. Check kubectl logs kube-starrocks-cn-1 for "Out of memory" or crash signals.
2. RPC Thread Pool Saturation
Each INSERT statement consumes resources in the RPC thread pool on both the FE and CN.
* What's happening: If you start the next insert immediately, you might be exhausting the available threads for the "Publish Version" task, especially if the previous insert's cleanup isn't fully done.
* Action: Monitor the FE metric publish_version_thread_pool_queue_count. If it's high, you should increase the thread pool size on the FE:
sql
ADMIN SET FRONTEND CONFIG ("lake_publish_version_max_threads" = "1024");
3. K8s Network "Zombie" Connections
In Kubernetes, if a pod is under extreme load, it might stop responding to heartbeats, leading the K8s service or the StarRocks FE to believe the node is down.
* What's happening: The FE tries to send the "Publish" command to an IP address that K8s is in the middle of rotating or that is currently dropped from the service mesh/load balancer.
* Action: Ensure your CN pods have sufficient CPU/Memory requests and limits in your Helm chart or YAML to prevent them from being throttled or evicted during peak ETL.
4. Compaction Backpressure
As discussed previously, PK tables require heavy compaction.
* What's happening: If compaction scores are high, the CN may be so busy with I/O that it fails to respond to RPC requests from the FE within the timeout period.
* Action: Slow down the frequency. Add a small buffer (e.g., sleep 5) between your ETL runs, or move to larger batch sizes (e.g., 1 million rows per insert instead of 100k).
Recommended Troubleshooting Steps:
1. Check FE Logs: Look for the full stack trace in fe.log around the time of the error. It will tell you if the connection was "Refused" or "Timed out."
2. Check CN Health: Verify the CN process is still running: SHOW COMPUTE NODES; and check the Alive column.
3. Batching: If you are running multiple small inserts per minute, combine them. This is the #1 way to solve "Publish Version" errors in StarRocks.
Summary of Best Practices for this ETL:
* Batch Size: Aim for at least 100MB+ or 500k+ rows per INSERT to minimize the number of versions.
* Wait for Success: Ensure your ETL script checks the return code of the SQL execution before starting the next one.
* Primary Key Index: Ensure persistent_index is enabled on the PK table to reduce CN memory usage.GregM
10/06/2026, 2:35 PMPROPERTIES (
"cloud_native_fast_schema_evolution_v2" = "TRUE",
"compression" = "LZ4",
"datacache.enable" = "TRUE",
"enable_async_write_back" = "FALSE",
"enable_persistent_index" = "TRUE",
"file_bundling" = "TRUE",
"persistent_index_type" = "CLOUD_NATIVE",
"replication_num" = "1",
"storage_volume" = "builtin_storage_volume"
);
we are inserting 10m records at a time and starting the next insert right after success of the first oneRocky
10/06/2026, 2:35 PM"persistent_index_type" = "CLOUD_NATIVE" and "file_bundling" = "TRUE" is the best practice for high-volume ingestion in this architecture.
However, the "back-to-back" ingestion of 10 million records is likely causing the link rpc channel failed error due to Compute Node (CN) saturation during the "Publish Version" phase.
Why the error occurs
When an INSERT succeeds in the client, the StarRocks FE has committed the transaction, but the CN node may still be finishing background tasks (like updating the Cloud Native index or handling metadata).
If you start the next 10m-record insert immediately:
1. RPC Thread Exhaustion: The FE tries to open a new RPC connection to the CN to coordinate the next load while the CN is still heavily taxed by the previous one.
2. CN Resource Spike: Processing 10m PK records involves a massive "Apply" phase (calculating delete vectors and uploading index segments to object storage). This causes high CPU and network I/O, which can cause the CN to briefly stop responding to heartbeat/RPC requests, leading K8s to drop the connection or the FE to report "link failed."
3. Memory Pressure: Even with persistent index, the "Apply" phase for 10m records requires significant memory buffer. Back-to-back runs don't give the CN time to release these buffers.
Recommendations & Best Practices
1. Introduce a "Cool-down" Period
Even 5–10 seconds between batches can significantly improve stability. It allows the CN to finish uploading metadata to object storage and clear its RPC queues.
2. Enable Batch Publish (Shared-Data Only)
If you are on StarRocks v3.2.3 or higher, enable this FE configuration to optimize how transactions are finalized. It reduces the RPC overhead between FE and CN:
sql
ADMIN SET FRONTEND CONFIG ("lake_enable_batch_publish_version" = "true");
3. Stabilize RPC & Publishing
Increase the thread pool and timeouts to handle the temporary pressure of 10m-record batches:
* FE Config:
sql
ADMIN SET FRONTEND CONFIG ("lake_publish_version_max_threads" = "1024");
* CN Config (via be.conf or information_schema.be_configs):
Increase the worker threads dedicated to applying PK updates in a shared-data cluster:
sql
UPDATE information_schema.be_configs
SET VALUE = "16" -- Adjust based on your CN core count
WHERE name = "transaction_publish_version_worker_count";
4. Check for K8s Restarts
The link rpc channel failed often happens because a CN pod crashed and restarted.
* Check your CN pod status: kubectl get pods -n <namespace>.
* If RESTARTS is $> 0$, check kubectl describe pod <cn-pod-name> for an OOMKilled event.
* If OOM occurs, you may need to increase the memory limit for your CN pods or decrease the batch size to 5 million.
5. Verify Compaction Health
Check if compaction is falling behind due to the continuous load:
sql
-- Check for high compaction scores (> 100)
SHOW PROC '/lake_compaction';
If the score is consistently high, the FE will eventually start intentionally delaying your inserts, which can also cause RPC timeouts.
Summary
Your batch size (10m) is good, but the frequency (zero delay) is the bottleneck. Enabling lake_enable_batch_publish_version and adding a 5-10 second sleep between batches should resolve the "link rpc channel failed" error.
References
• knowledge/usage/load/shared_data_batch_ingestion.md
• table_design/table_types/primary_key_table.md
• best_practices/primarykey_table.md
• deployment/shared_data/feature-support-shared-data.mdGregM
10/06/2026, 2:41 PM512, should I bump that? Similarly, should I bump tablet_create_timeout_second up from 60? lake_enable_batch_publish_version is already trueRocky
10/06/2026, 2:42 PMlake_publish_version_max_threads to 1024 won't hurt, but it is unlikely to solve a "link rpc channel failed" error. That thread pool controls how many concurrent transactions the FE can start publishing, whereas your error indicates that a connection to a specific CN node was physically dropped or refused during the process.
Similarly, bumping tablet_create_timeout_second will not help, as that setting only affects the creation of new tablets/partitions, not the ingestion of data into existing ones.
Instead, you should focus on the RPC timeout and CN-side execution threads. Here is the recommended tuning for your 10M-record batch workload:
1. Increase Publish Version Timeout (FE)
For 10M records in a Primary Key table, the "Apply" phase (where the CN calculates delete vectors and updates the index) can take a significant amount of time. If the FE doesn't hear back within the timeout, it may close the channel.
* FE Config:
sql
ADMIN SET FRONTEND CONFIG ("publish_version_timeout_second" = "120"); -- Increase from default (usually 30 or 60)
2. Increase CN-side Worker Threads
The CN needs enough threads to "apply" the 10 million changes to the tablets. If this pool is too small, the RPC requests from the FE will sit in a queue until the channel eventually times out or fails.
* CN Config (Runtime update):
sql
UPDATE information_schema.be_configs
SET VALUE = "16" -- Recommended: Set to 1/2 or equal to your CN CPU cores
WHERE name = "transaction_publish_version_worker_count";
3. Check for Network/CPU Saturation
The "link rpc channel failed" error is often a side effect of the CN being CPU-pinned.
* When a CN reaches 100% CPU usage while processing the 10M record batch, it may fail to respond to the FE's heartbeats or RPC "ping" in a timely manner. Kubernetes or the StarRocks FE then interprets this as a network failure.
* Fix: If your CNs are at $>90\%$ CPU during the insert, you must either:
* Add a small sleep (e.g., 10s) between batches to let the CPU "drain" the background index uploads.
* Increase the CPU resources for your CN pods.
4. Verify brpc constraints
If you still see "link failed" after the above, it could be a brpc (the underlying RPC framework) buffer limit.
* Check the CN logs (<http://be.INFO|be.INFO>) for messages like Reached brpc_socket_max_unwritten_bytes.
* If found, you may need to increase the CN config brpc_socket_max_unwritten_bytes from its default.
Summary
* Do NOT bump tablet_create_timeout_second.
* Bumping lake_publish_version_max_threads is fine but likely irrelevant.
* DO bump publish_version_timeout_second (FE) and transaction_publish_version_worker_count (CN).
* Crucial: Even with these settings, back-to-back 10M record inserts into a PK table is a "heavy" operation. Adding a 10-second gap between your ETL scripts is the most effective way to ensure long-term stability.
References
• administration/management/FE_configuration.md
• administration/management/BE_configuration.md
• faq/shared_data_faq.md
• faq/loading/Loading_faq.md
References
• faq/shared_data_faq.md
• quick_start/shared-data.md
• faq/loading/Insert_into_faq.mdGregM
10/06/2026, 2:45 PMpublish_version_timeout_second or transaction_publish_version_worker_countRocky
10/06/2026, 2:46 PMtransaction_publish_version_worker_count (CN side)
This is a Compute Node (BE) configuration, not an FE one. You won't see it using ADMIN SHOW CONFIG.
* How to check:
sql
SELECT * FROM information_schema.be_configs
WHERE name = 'transaction_publish_version_worker_count';
* How to set (Runtime):
sql
UPDATE information_schema.be_configs
SET VALUE = "16" -- Set this to roughly 1/2 or equal to your CN CPU cores
WHERE name = "transaction_publish_version_worker_count";
* Note: If you still don't see it, it may be because you are on an older version. In that case, check for transaction_apply_worker_count, which handles the "Apply" phase for Primary Key tables.
2. publish_version_timeout_second (FE side)
This is a Frontend (FE) configuration. If ADMIN SHOW CONFIG doesn't show it, try searching for any "publish" or "timeout" related configs specifically:
* Search command:
sql
ADMIN SHOW CONFIG LIKE '%publish%';
ADMIN SHOW CONFIG LIKE '%timeout%';
* In some versions, the FE-side timeout for publishing is internal or tied to the query_timeout or stream_load_default_timeout_second.
* Recommendation: If you cannot find a specific "publish" timeout, increase your session's query timeout before running the insert:
sql
SET query_timeout = 3600; -- Increase to 1 hour for large 10M batches
Why you should still bump lake_publish_version_max_threads
You mentioned your lake_publish_version_max_threads is 512. While this is usually plenty, in a "back-to-back" 10M record load scenario, a single publish task can take a long time to return. If you have many partitions or concurrent loads, those 512 slots can fill up.
* Bumping it to 1024 ensures the FE isn't the bottleneck for starting the publish command.
Key takeaway for the "link rpc channel failed" error:
Because you are seeing a network link failure, the most effective fix is almost always on the CN side:
1. CPU Throttling: Check if your CN pod is hitting 100% CPU during the "Apply" phase of your 10M record insert. If it is, it will stop responding to the FE's RPC calls.
2. CN Threading: Ensure transaction_publish_version_worker_count or transaction_apply_worker_count (on the CN) is high enough to process the 10M records quickly.
3. The "Gap": Even with perfect configs, 10M record batches are heavy. A 10-second sleep between your scripts will give the CN time to finish background metadata uploads and clean up its memory, which is the most reliable way to prevent RPC drops.
References
• administration/management/BE_configuration.md
• administration/management/FE_configuration.md
• administration/management/information_schema.md
• table_design/table_types/primary_key_table.md
References
• administration/management/FE_configuration.mdGregM
10/06/2026, 2:51 PMtransaction_publish_version_worker_count is currently set to 0Rocky
10/06/2026, 2:52 PM0 for these worker counts is actually a special setting that means "Auto-calculate based on CPU cores."
Why it is set to 0
* transaction_publish_version_worker_count: When set to 0, the system uses the number of CPU cores on the CN/BE node as the thread count. This is intended to prevent thread exhaustion during high-concurrency imports.
* transaction_apply_worker_count: Similarly, 0 defaults to the CPU core count. This pool is responsible for the "Apply" phase of Primary Key tables (calculating delete vectors and updating the index), which is the most intensive part of your 10M record insert.
Should you change it?
While 0 (auto) is generally good, for 10-million-record batches, the "Apply" phase can be so intensive that it pins your CPUs to 100%. When the CPU is fully saturated, the CN may fail to respond to "heartbeat" RPC calls from the FE, causing the link rpc channel failed error you are seeing.
Try these specific adjustments to stabilize the RPC connection:
1. Limit the "Apply" Threads (CN)
If your CNs have a very high core count (e.g., 32 or 64 cores), the "Apply" process might be trying to do too much at once, causing resource contention. Try setting a fixed limit to leave some headroom for the system to handle RPC requests:
sql
UPDATE information_schema.be_configs
SET VALUE = "16" -- Try 16 as a starting point, or 50% of your total cores
WHERE name = "transaction_apply_worker_count";
UPDATE information_schema.be_configs
SET VALUE = "16"
WHERE name = "transaction_publish_version_worker_count";
2. Increase RPC Buffer (CN)
The "link failed" error often happens when the underlying RPC buffer is overwhelmed by metadata updates from a 10M record batch.
sql
UPDATE information_schema.be_configs
SET VALUE = "1073741824" -- Increase to 1GB (default is often lower)
WHERE name = "brpc_socket_max_unwritten_bytes";
3. Adjust FE Publish Timeout
Since you are doing back-to-back large inserts, the FE might be timing out while waiting for the CN to finish the "Apply" phase. StarRocks uses a few different timeout configs depending on the version. Try setting this on the FE:
sql
ADMIN SET FRONTEND CONFIG ("publish_version_timeout_second" = "120");
Final Troubleshooting Tip
Check your CN logs (<http://be.INFO|be.INFO>) for the string "reached brpc_socket_max_unwritten_bytes".
* If you see this, it confirms the RPC channel is being dropped because the metadata being sent back to the FE is too large for the current buffer.
* If you see "heartbeat timeout", it confirms the CN is too CPU-busy to reply to the FE, and you should definitely lower the worker counts from 0 to a fixed number like 16.
Recommendation: Even with these fixes, a 5-10 second sleep between your inserts is the most reliable way to let the CN "breathe" and finish background tasks before the next 10M records arrive.
References
• administration/management/FE_configuration.md
• administration/management/compaction.md
• administration/management/monitoring/metrics.md
• administration/management/BE_configuration.md
• deployment/plan_cluster.mdGregM
10/06/2026, 3:00 PM5406426|transaction_apply_worker_idle_time_ms |500 |
5406426|transaction_publish_version_thread_pool_idle_time_ms|60000|Rocky
10/06/2026, 3:02 PMtransaction_apply_worker_idle_time_ms (500ms): This tells the CN how long to keep an "apply" thread alive after it finishes a task before killing it to save memory.
* transaction_publish_version_thread_pool_idle_time_ms (60,000ms): This does the same for the "publish version" thread pool, keeping threads alive for 1 minute of inactivity.
Why they don't matter for your error
The "link rpc channel failed" error happens because the connection is dropping during active work, not because threads are being cleaned up while idle.
* During a 10M record insert, these threads are extremely busy; they aren't "idle," so these timeouts never trigger.
* Even if they did trigger, creating a new thread takes microseconds—it wouldn't cause an RPC channel to physically fail or time out.
What actually matters (Recap)
Since you confirmed your worker counts are at 0 (auto-scaling to CPU cores), your CN is likely trying to use every single CPU core to process that 10M record batch as fast as possible. This "pins" the CPU at 100%, which prevents the CN from responding to the FE's network heartbeats.
The most effective changes for your specific situation are:
1. transaction_apply_worker_count: Change this from 0 to a fixed number (e.g., 16) to leave some CPU "breathing room" for network tasks.
2. brpc_socket_max_unwritten_bytes: Increase this on the CN to prevent the RPC buffer from overflowing during large metadata updates.
3. Insert Gap: Add that 5–10 second sleep between your 10M record batches. This allows the CN to finish its background I/O (uploading the new delete vectors and indexes to object storage) before the next massive wave of data hits.
References
• administration/management/BE_configuration.md
• administration/management/FE_configuration.md
• faq/loading/Insert_into_faq.md
• administration/management/information_schema.md
References
• administration/management/BE_configuration.md
• administration/management/monitoring/metrics.mdGregM
10/06/2026, 3:55 PMRocky
10/06/2026, 3:55 PMtransaction_apply_worker_count at a fixed value (like 16 or 32) instead of 0 for these 10M record loads. The combination of the more stable v4.1.16 code and a controlled thread pool will likely eliminate the "link rpc channel failed" error entirely.
References
• release_notes/release-3.3.md
• administration/management/BE_configuration.md
• table_design/table_types/primary_key_table.md
• administration/management/FE_configuration.md
• deployment/plan_cluster.md
References
• release_notes/release-3.3.md
• release_notes/release-3.1.mdGregM
10/06/2026, 3:56 PMRocky
10/06/2026, 3:57 PMsql
-- Run these on the FE Leader
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_scheduling_tablets" = "0");
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_balancing_tablets" = "0");
ADMIN SET FRONTEND CONFIG ("disable_balance" = "true");
ADMIN SET FRONTEND CONFIG ("disable_colocate_balance" = "true");
2. Upgrade Order
To maintain cluster availability, always upgrade in this specific order:
1. CN Nodes (one by one or in batches)
2. FE Follower Nodes
3. FE Leader Node (last)
──────────
3. Upgrade Procedure (Per Node)
For CN Nodes:
Repeat these steps for each CN:
1. Stop the node gracefully:
bash
cd <cn_dir>/be
./bin/stop_cn.sh --graceful
2. Replace Binaries: Backup your old bin and lib folders, then copy the new ones from the 4.1.16 package:
bash
mv bin bin.bak && mv lib lib.bak
cp -r /tmp/StarRocks-4.1.16/be/bin .
cp -r /tmp/StarRocks-4.1.16/be/lib .
3. Start the node:
bash
./bin/start_cn.sh --daemon
4. Verify: Check that the CN is Alive using SHOW COMPUTE NODES; in your SQL client.
For FE Nodes:
Upgrade all Followers first, then the Leader:
1. Stop the node:
bash
cd <fe_dir>/fe
./bin/stop_fe.sh
2. Replace Binaries:
bash
mv bin bin.bak && mv lib lib.bak && mv spark-launcher spark-launcher.bak
cp -r /tmp/StarRocks-4.1.16/fe/bin .
cp -r /tmp/StarRocks-4.1.16/fe/lib .
cp -r /tmp/StarRocks-4.1.16/fe/spark-launcher .
3. Start the node:
bash
./bin/start_fe.sh --daemon
4. Verify: Check SHOW FRONTENDS;. Ensure the Join status is true and the version reflects 4.1.16.
──────────
4. Post-Upgrade
Once all nodes are upgraded and showing as Alive, re-enable the balancer:
sql
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_scheduling_tablets" = "10000");
ADMIN SET FRONTEND CONFIG ("tablet_sched_max_balancing_tablets" = "500");
ADMIN SET FRONTEND CONFIG ("disable_balance" = "false");
ADMIN SET FRONTEND CONFIG ("disable_colocate_balance" = "false");
Note: Since you are moving to a much later patch version, you should see immediate improvements in the "Publish" stability we discussed earlier.
References
• deployment/upgrade.md
• deployment/shared_data/s3.md
• administration/management/FE_configuration.md
• administration/management/BE_configuration.md
• administration/management/information_schema.md
References
• deployment/upgrade.md
• deployment/deployment_overview.mdGregM
10/06/2026, 4:08 PMRocky
10/06/2026, 4:08 PMlake_enable_protobuf_file_checksum, which helps detect if metadata corruption or network truncated files are causing the RPC failures you see during the "Publish" phase.
2. AWS SDK Stability: In v4.1.6, the default HTTP client for the AWS SDK was stabilized (reverting to the SDK's native client by default). This often resolves hidden timeouts during S3 uploads that manifest as "RPC channel failed" when the CN hangs waiting for the object store.
3. Large-Capacity Tablet Support: The logic for handling 100GB tablets (which reduces metadata pressure on the FE) was matured between .1 and .6.
4. Memory Management: v4.1.6 enabled `jemalloc`'s dedicated oversize arena by default. This is specifically helpful for 10M record inserts, as large buffers for delete vectors and indexes are handled more efficiently, reducing the chance of a "stop-the-world" memory stall that drops RPC connections.
Upgrade Path & Docs
The procedure I provided earlier remains exactly the same for v4.1.6:
1. Backup your metadata (FE image files).
2. Disable the balancer (ADMIN SET FRONTEND CONFIG ("disable_balance" = "true");).
3. Upgrade CNs first, then FE Followers, then the FE Leader.
4. Binaries: Use the bin and lib from the 4.1.6 package.
One specific detail for 4.1.6:
If you are using AWS S3, v4.1.6 changes a default behavior: enable_poco_client_for_aws_sdk now defaults to false. This is generally good for stability, so you shouldn't need to change it unless you had custom network proxy settings that required the Poco client.
Summary
While v4.1.16 is even better, v4.1.6 is a massive upgrade over v4.1.1 for production stability. It is highly recommended to proceed with the upgrade to resolve your ingestion timeouts.
References
• deployment/upgrade.md
• release_notes/release-3.3.md
• administration/management/BE_configuration.md
• administration/management/FE_configuration.md
• deployment/plan_cluster.md
References
• deployment/upgrade.md
• release_notes/release-3.1.md
References
• deployment/upgrade.md
• knowledge/admin_and_operation/shared_data_compaction.mdGregM
10/06/2026, 4:09 PMRocky
10/06/2026, 4:10 PMlake_enable_protobuf_file_checksum):
By default in 4.1.6, tablet metadata and transaction logs now include an Adler-32 checksum. This helps the system immediately detect and handle corrupted or truncated files in object storage that previously caused the FE or CN to hang indefinitely while waiting for an RPC response.
4. AWS SDK Stability:
v4.1.6 switches the default AWS SDK client back to the native SDK client (setting enable_poco_client_for_aws_sdk to false by default). This has been shown to resolve "ghost" timeouts in high-load scenarios where the previous client would drop connections during S3 metadata writes.
Recommendation
* Upgrade to v4.1.6, not 4.1.16.
* This version specifically includes the "version skip" and "publish throttle" logic that were ported from the final 4.0.x patches to make the 4.1 line production-ready.
* You can find the official release notes under the StarRocks 4.1 section in the documentation.
References
• release_notes/release-4.0.md
• deployment/upgrade.md
• administration/management/BE_configuration.md
• administration/management/FE_configuration.md
• deployment/plan_cluster.md
References
• release_notes/release-3.3.md
• release_notes/release-3.1.md
References
• release_notes/release-4.0.mdGregM
10/06/2026, 4:25 PMRocky
10/06/2026, 4:25 PMbash
helm repo update starrocks
helm upgrade <operator-release-name> starrocks/operator --version 1.11.7
2. Verify Operator health: Ensure the operator pod is running and healthy.
3. Upgrade StarRocks: Update your StarRocksCluster YAML (or Helm values) to point to the 4.1.6 image. The newly upgraded operator will then manage the rollout of your CNs and FEs in the correct order.
Note: Since you are moving to StarRocks 4.1.6, using the latest 1.11.x operator ensures full compatibility with any minor spec changes introduced in the 4.1 branch.
References
• deployment/upgrade.md
• deployment/helm.md
• deployment/k8s_operator.md
• administration/management/FE_configuration.md
• administration/management/BE_configuration.md
References
• deployment/upgrade.md
• deployment/deployment_overview.md
• release_notes/release-4.0.mdGregM
10/06/2026, 4:26 PMRocky
10/06/2026, 4:27 PMhelm upgrade. If there are new fields or logic in the v1.11.7 operator that your v1.11.4 CRD doesn't know about, the operator might fail to reconcile the cluster or the Helm upgrade itself might error out.
Upgrade Steps
Run these commands in order to ensure a clean transition:
1. Update the CRD first:
bash
kubectl apply -f <https://raw.githubusercontent.com/StarRocks/starrocks-kubernetes-operator/v1.11.7/deploy/starrocks.com_starrocksclusters.yaml>
2. Update your Helm repository:
bash
helm repo update starrocks
3. Upgrade the Operator:
bash
helm upgrade <your-operator-release-name> starrocks/operator --version 1.11.7
Why this is necessary
In the v1.11.x branch, StarRocks has been adding support for newer Kubernetes features (like podManagementPolicy and enhanced security contexts). These require the schema in the CRD to be updated so that the Kubernetes API server can validate the new fields in your StarRocksCluster YAML. Applying the CRD manually is a safe, non-destructive operation that simply adds these new definitions to your cluster.
References
• deployment/helm.md
• deployment/k8s_operator.md
• deployment/sr_operator.md
• administration/management/FE_configuration.md
• administration/management/BE_configuration.md
References
• deployment/helm.md
• deployment/deployment_overview.md
• release_notes/release-4.0.md
References
• administration/management/resource_management/Memory_management.md
• administration/management/BE_configuration.md
• sql-reference/System_variable.md
• administration/management/resource_management/Query_management.md
• using_starrocks/caching/query_cache.mdGregM
10/06/2026, 5:09 PMFail to publish partition 6099309 error Fail to publish version for tablets:[[6099313, 6099310, 6099315, 6099311, 6099314, 6099312]], error msg: sstables are not ordered, last_max_rss_rowid=781684047871 : max_rss_rowid=781684047870, host: kube-starrocks-cn-0.kube-starrocks-cn-search.kube-starrocks.svc.cluster.local
Rocky
10/06/2026, 5:11 PMlast_max_rss_rowid=...71 and max_rss_rowid=...70 show that the CN node is trying to publish a new data version, but the unique ID assigned to the new rowset is lower than the previous one. This violates a core safety check in the storage engine.
Why did this happen?
In StarRocks v4.1.6, several fundamental changes were made to how shared-data metadata is handled:
1. Checksums Enabled: lake_enable_protobuf_file_checksum was turned on by default.
2. Version Skip Optimization: The system now jumps directly to the final version of a batch publish.
3. Persistent Index Format: There were refinements in how the Persistent Index (the "sstables" mentioned in the error) handles max_rss_rowid during high-concurrency loads.
It is likely that your CN node (kube-starrocks-cn-0) has stale metadata or a corrupted index cache in memory that was carried over during the rolling upgrade, or it is misinterpreting the older metadata format under the new 4.1.6 checksum rules.
Recommended Fixes (In Order)
1. Clear the CN Metadata Cache (Restart CNs)
Since the error is reported by the CN, the first step is to force it to reload the tablet metadata from S3/Object Storage.
* Action: Restart all CN pods. In Kubernetes, you can simply delete the pods and let the Operator recreate them, or trigger a rollout:
bash
kubectl rollout restart statefulset <cluster-name>-cn -n <namespace>
2. Disable the new Checksum Feature
If the restart doesn't work, the error might be triggered by the new checksum logic misreading an older metadata file.
* Action: Add the following to your CN (and FE) configuration (under config in your StarRocksCluster CRD) and restart:
yaml
lake_enable_protobuf_file_checksum: "false"
3. Disable Metadata Cache Temporarily
If the CN is still "remembering" the old rowset IDs, disable the metadata cache to force every read to go to the object store:
* Action: Set this in your CN configuration:
yaml
lake_enable_metadata_cache: "false"
4. Rebuild the Index (If only one table is affected)
If this error only happens on a specific table, the Persistent Index for that partition might be genuinely inconsistent. You can force a rebuild by disabling the persistent index for that table and then re-enabling it:
* SQL:
sql
ALTER TABLE <table_name> SET ("enable_persistent_index" = "false");
-- Wait a minute for the system to process
ALTER TABLE <table_name> SET ("enable_persistent_index" = "true");
Summary of what to check
* Ensure all FEs and CNs are successfully running v4.1.6. A version mismatch between the FE (which assigns IDs) and CN (which applies them) is a common cause for "out of order" errors.
* Check the FE leader logs (fe.log) for any PUBLISH_VERSION errors occurring at the same time; this will confirm if the FE is the one sending the "wrong" ID.
References
• administration/management/BE_configuration.md
• release_notes/release-4.0.md
• administration/management/FE_configuration.md
• administration/management/compaction.md
• deployment/upgrade.md
References
• release_notes/release-4.0.md
• administration/management/BE_configuration.md
ReferencesRocky
10/06/2026, 5:11 PMGregM
10/06/2026, 5:31 PMALTER TABLE <table_name> SET ("enable_persistent_index" = "false");Rocky
10/06/2026, 5:32 PMALTER TABLE ... SET ("enable_persistent_index" = "false") command can appear hung if it is waiting for a metadata lock or if the table has a very large number of tablets that need to be updated in the FE's catalog.
Since you are seeing specific tablet IDs in your error message, you should use a more surgical approach that was specifically added for shared-data (lake) clusters to resolve index corruption.
1. Check for Locks
The ALTER command might be waiting on an internal lock. Run this to see if there is a long-running transaction or another schema change blocking it:
sql
SHOW FULL PROCESSLIST;
-- Also check if there are stuck transactions
SHOW PROC '/transactions';
If you see your ALTER command in the process list with a long time, it is likely waiting for a metadata lock. You can try to kill it using KILL <query_id>; if it doesn't progress.
2. Use the Targeted "Drop Index" Command
Instead of disabling the index for the entire table, StarRocks (since v3.3.9) supports dropping the persistent index for specific tablets. This is much faster and directly addresses the tablets reporting the sstables are not ordered error.
Run this command for the tablets mentioned in your error:
sql
ALTER TABLE <your_table_name>
DROP PERSISTENT INDEX ON TABLETS (6099313, 6099310, 6099315, 6099311, 6099314, 6099312);
What this does:
* It deletes the corrupted index files from your object storage (S3/GCS/OSS) for only those tablets.
* The next time a write or query hits those tablets, the CN will automatically rebuild the index from the data files.
* This is a "safe" operation because the index is just a cache of the Primary Key locations; the actual data remains intact.
3. Check Progress
If you want to see if the system is still working on a table-level change, use:
sql
SHOW ALTER TABLE COLUMN;
-- Or if it's treated as a property optimization:
SHOW ALTER TABLE OPTIMIZE;
Why did the error happen?
The error last_max_rss_rowid=...71 : max_rss_rowid=...70 means the sequence of row IDs in the index went backwards. This usually happens during an upgrade if a compaction task was partially committed or if there was a race condition in the Persistent Index's max_rss_rowid assignment (a known edge case in the storage engine). Dropping the index files for the affected tablets as shown in Step 2 is the standard recovery path.
References
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• sql-reference/sql-statements/table_bucket_part_index/SHOW_ALTER.md
• administration/management/BE_configuration.md
• faq/Sql_faq.md
• administration/management/FE_configuration.md
References
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• knowledge/admin_and_operation/shared_data_compaction.mdGregM
10/06/2026, 5:59 PMFail to publish partition 6111939 error Fail to publish version for tablets:[[6111945, 6111943, 6111942, 6111940, 6111944, 6111941]], error msg: sstables are not ordered, last_max_rss_rowid=12884901887 : max_rss_rowid=12884901886, host: kube-starrocks-cn-1.kube-starrocks-cn-search.kube-starrocks.svc.cluster.localRocky
10/06/2026, 6:00 PMmax_rss_rowid) assigned to each tablet. The error last_max_rss_rowid=...7 : max_rss_rowid=...6 means the system tried to commit a new batch of data with a "high water mark" lower than the previous one, which the storage engine rejects to prevent data corruption.
Since this is happening on a freshly recreated table, it confirms this is not an issue with "old" data, but rather a logic bug or a state synchronization issue in the StarRocks version you are running (likely a race condition between the FE and the multiple CN nodes during version publishing).
Recommended Resolution Steps
1. Clear the CN Local Index Cache (Critical)
Even if you drop the table, the CN nodes may keep local "Persistent Index" files on their local disks (in the /opt/starrocks/storage/ directory). If these files are not cleared, a new table might encounter "ghost" metadata if tablet IDs are reused or if the local disk state is stale.
* Action: If possible, delete the contents of the storage directory on your CN pods.
* In Kubernetes: The easiest way is to temporarily set the replicas of the CN component to 0 in your StarRocksCluster YAML, wait for the pods to terminate, and then scale back up. If you are using EmptyDir for storage, this will wipe the cache. If using PersistentVolumeClaims, you may need to manually clear the mount point or recreate the PVCs.
2. Disable "Eager Build" of the Index
There is a known edge case where "Eager Building" of the persistent index during the write phase can lead to out-of-order sequence assignment in certain 3.x/4.x versions.
* Action: Add this to your CN (BE) configuration and restart:
yaml
enable_pk_index_eager_build: "false"
_ _Note: This might slightly slow down the first query after a load (as the index builds on demand), but it often bypasses the write-time ordering check.*
3. Disable Persistent Index entirely (Temporary Workaround)
If you need to get the data in immediately and the table is not massive (e.g., under 100 million rows per partition), you can store the Primary Key index in memory instead of on disk/S3. This avoids the sstable ordering logic entirely.
* Action: Recreate the table with persistent_index disabled:
sql
PROPERTIES (
"enable_persistent_index" = "false"
);
4. Check for Version Mismatch
Verify that all components (FE and CN) are on exactly the same image version.
* Run SHOW FRONTENDS; and SHOW BACKENDS; (or SHOW COMPUTE NODES;) and check the Version column.
* If you upgraded the FE but one CN failed to update, the FE might be sending "v4-style" publish commands that an "old" CN is misinterpreting, leading to the ID mismatch.
Why the IDs are so large
The IDs you see (12884901887) are roughly $3 \times 2^{32}$. This suggests the RowID is being encoded using a high bitmask (likely including a Rowset ID). The fact that it regresses by exactly 1 on a second insert on a different CN (kube-starrocks-cn-1) strongly suggests that the FE is not correctly synchronizing the "Next RowID" sequence to all CNs after the first insert.
If the issue persists after clearing the CN storage, please provide the exact StarRocks image version (e.g., 3.3.2, 4.0.1) so I can check for specific bug fixes in the release notes.
References
• administration/management/BE_configuration.md
• administration/management/monitoring/metrics.md
• administration/management/FE_configuration.mdGregM
10/06/2026, 6:02 PMRocky
10/06/2026, 6:03 PMsstables are not ordered, last_max_rss_rowid=...87 : max_rss_rowid=...86 means the storage engine detected that the "high-water mark" for row IDs in the tablet’s index actually moved backward by one, which usually indicates a metadata synchronization failure between the FE and the CN nodes.
1. The Immediate Fix (Configurations)
Because you are on 4.1.6, where several storage safety checks were tightened, you should disable the following features that are known to trigger this specific ordering race condition:
On all CN nodes (and BEs), add to `be.conf`:
yaml
# Disable the new 4.1 checksum which can cause misreads of the index tail
lake_enable_protobuf_file_checksum: "false"
# Disable the metadata cache to ensure CNs don't use stale RowID high-water marks
lake_enable_metadata_cache: "false"
On the FE node, add to `fe.conf`:
yaml
# Disable batching of publish tasks to ensure strict sequential rowid assignment
lake_enable_batch_publish_version: "false"
Note: After applying these, restart the cluster. Since you already recreated the table, these settings will prevent the "second insert" from failing again.
2. Why the ALTER TABLE hung
The command ALTER TABLE ... SET ("enable_persistent_index" = "false") likely hung because the failed "Publish" task from your first/second insert is still "in-flight" or stuck in the FE's transaction queue.
* To clear it: Check SHOW PROC '/transactions';. If you see transactions for that table in a PREPARED or COMMITTED state but not VISIBLE, they are blocking metadata changes.
* Kill the blocked task: You can try to find the query ID of the ALTER and use KILL <query_id>, or restart the FE leader to clear the metadata lock.
3. Surgical Tablet Recovery
Since you know exactly which tablets are failing (6111945, 6111943, etc.), you can force the system to "forget" the bad index state for just those tablets without dropping the whole table again:
sql
ALTER TABLE <table_name>
DROP PERSISTENT INDEX ON TABLETS (6111945, 6111943, 6111942, 6111940, 6111944, 6111941);
In StarRocks 4.x, this command is optimized for shared-data. It deletes the .index files in your object storage for those tablets. The next insert will see they are missing and rebuild them from scratch with the correct sequence.
4. Why it happened on a fresh table
In version 4.1.6, StarRocks introduced a change where rowset IDs and max_rss_rowid are tracked more aggressively for compaction. If lake_enable_protobuf_file_checksum is enabled (the default in 4.1), and a CN fails to write the checksum correctly or reads a partial file from the cache, it can result in the last_max_rss_rowid being reported as N while the new write is N-1. Turning off the checksum (as shown in Step 1) is the recommended workaround for this version.
Recommendation: If this is a production cluster, consider checking if a patch for 4.1.7 or 4.1.8 is available, as these versions specifically address the sstables are not ordered race condition during batch publishing.
References
• administration/management/BE_configuration.md
• administration/management/FE_configuration.md
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• release_notes/release-4.0.md
References
• administration/management/FE_configuration.mdRocky
10/06/2026, 6:03 PMGregM
10/06/2026, 6:30 PMRocky
10/06/2026, 6:30 PMsstable_meta file that doesn't match the new table's state, it can lead to exactly the sequence regression you are seeing.
However, since this is a freshly recreated table, if clearing the PVCs does not work, it indicates the issue is not in the cache, but in the logic of the 4.1.6 engine during the write/publish phase.
Why clearing PVCs might (or might not) work:
1. If it works: The issue was likely a "ghost" of the old table. CN nodes sometimes fail to invalidate local cache entries immediately when a table is dropped and recreated with the same name/structure, leading to a collision in the local directory.
2. If it fails: The logic bug in 4.1.6 is likely related to Batch Publishing or the new Adler-32 Checksum feature introduced in this version.
Why the "Step Backward" (Disabling Features) is recommended:
I understand that disabling features like checksums or batch publishing feels like a regression. However, in the 4.1.x series (specifically 4.1.6), these are the specific areas where StarRocks recently tightened the storage safety checks.
The error last_max_rss_rowid=...87 : max_rss_rowid=...86 is a hard safety check. It means the engine thinks time is moving backward for that tablet. If clearing the PVC doesn't fix it, the system is likely suffering from a race condition where:
* Batch Publish (lake_enable_batch_publish_version): The FE is sending multiple version updates to the CN at once, and they are being applied out-of-order or with inconsistent sequence IDs.
* Checksums (lake_enable_protobuf_file_checksum): A new feature in 4.1.6. If there is a bug in the checksum verification, it can cause the CN to misread the tail of the persistent index, leading it to think the "max ID" is lower than it actually is.
Recommendation
1. Proceed with clearing PVCs: This is the cleanest way to "reset" the CNs.
2. Check for 4.1.7: If you are on 4.1.6 and this persists on a clean PVC, it is almost certainly a bug. Historically, the StarRocks team releases patch versions (like 4.1.7) very quickly after a minor release to address "sstables are not ordered" regressions.
3. Surgical Fix: If only a few tablets are stuck, use the command I mentioned previously:
sql
ALTER TABLE <table_name> DROP PERSISTENT INDEX ON TABLETS (...);
This forces the system to re-read the data from object storage and rebuild the index sequence from scratch, bypassing any local cache issues.
References
• administration/management/BE_configuration.md
• administration/management/FE_configuration.md
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• knowledge/admin_and_operation/shared_data_compaction.md
• releasenotes/release-4.1.md
References
• faq/Others.md
• knowledge/admin_and_operation/shared_data_compaction.mdGregM
10/06/2026, 6:47 PMRocky
10/06/2026, 6:47 PMmax_rss_rowid for every tablet to ensure data integrity and correct sequencing. When an insert spans multiple partitions, it involves a significantly higher number of tablets and concurrent metadata updates in the FrontEnd (FE).
Here is why multi-partition inserts are triggering this in version 4.1.6:
1. Batch Publish Race Condition
In 4.1.x, the parameter lake_enable_batch_publish_version is enabled by default. This feature allows the FE to group "Publish Version" tasks for different tablets and partitions into a single batch to reduce S3/object storage RPC calls.
* The Issue: When you hit multiple partitions, the FE has to manage a much larger set of tablets. There is a known bug in 4.1.6 where the FE's calculation of the "Next RowID" for a tablet can become inconsistent if multiple publish tasks for the same transaction are processed in a specific order.
* The Result: One tablet receives a "Publish" command with a max_rss_rowid (e.g., ...86) that is lower than the one it just processed for the previous partition or segment (e.g., ...87), causing the "sstables are not ordered" error.
2. Transaction Scope
Unlike single-partition tables, multi-partition inserts create larger transactions. If your "second insert" involves overlapping data or if the first insert hadn't fully finished its "background" metadata cleanup (vacuuming or persistent index committing), the FE might provide a stale high-water mark for the row IDs to the CN nodes.
3. Why other tables work
If your other PK tables are smaller or inserts only hit one partition, the "Batch Publish" logic is much simpler (often just one task), so the race condition never triggers. The complexity of coordinating the rowid sequence across N partitions simultaneously is what exposes this 4.1.6 bug.
Updated Recommendation
Since you are already clearing the PVCs (which is good for ruling out local cache corruption), if the error returns on the next multi-partition insert, you should apply these targeted changes to stabilize the FE logic:
1. Disable Batch Publishing (FE): This forces the FE to handle each partition's metadata update strictly and sequentially.
sql
ADMIN SET FRONTEND CONFIG ("lake_enable_batch_publish_version" = "false");
2. Verify Tablet Distribution: Check if your table has an unusually high number of buckets. If a multi-partition insert hits 10 partitions with 32 buckets each, that's 320 tablets being updated in one transaction. Reducing the bucket count (if they are small) can mitigate this by reducing the metadata overhead.
3. Upgrade to 4.1.7+: If possible, upgrade to the latest 4.1 patch. The 4.1.x series had several rapid fixes for Primary Key "ordering" errors specifically related to the Lake storage engine's metadata handling.
Summary: Your intuition is correct. The multi-partition nature of the load is stressing the FE's version coordination logic, which has a known flaw in 4.1.6 when batching is enabled.
References
• administration/management/BE_configuration.md
• administration/management/compaction.mdGregM
11/03/2026, 7:44 PMRocky
11/03/2026, 7:44 PMlake_enable_batch_publish_version): This feature, enabled by default in 4.1, allows the FrontEnd (FE) to batch metadata updates for multiple tablets. When an insert hits many partitions (and thus many tablets), the FE must coordinate a unique, monotonically increasing max_rss_rowid for every single one.
2. The Race Condition: In 4.1.6, there is a known edge case where, during high-concurrency or multi-partition loads, the FE can accidentally assign or "publish" a RowID sequence to a CN node that is lower than the one previously written to object storage.
3. The Safety Check: The error you see is a "Guardrail" in the storage engine. It detects that the new write would "overwrite" or "re-use" RowIDs that should have been incremented, so it aborts to prevent data corruption.
Next Steps & Possible Fixes
Since you are on 4.1.6:
* Check for 4.1.7+: Release notes indicate that 4.1.7 was released recently (October 2026) and includes specific stability fixes for the "Lake" Primary Key engine and batch publishing. If your environment allows, upgrading to the latest patch in the 4.1 branch is the most direct solution.
* FE Configuration: If you cannot upgrade immediately, the community recommendation for this specific "ordering" error in 4.1.6 is to disable batch publishing globally in the FE to force sequential, safe metadata updates:
sql
ADMIN SET FRONTEND CONFIG ("lake_enable_batch_publish_version" = "false");
* PVC Clearing: While clearing the PVCs ensures no "stale" metadata is on the CN, it won't fix the core logic if the FE is sending the wrong sequence numbers. If the error persists after the PVC wipe, the FE configuration change above is the only reliable workaround until the bug fix is applied.
I'll keep an eye on the progress of your GitHub issue; usually, for critical storage errors like this, the maintainers will prioritize a cherry-pick into the next 4.1 patch.GregM
11/04/2026, 6:49 PMRocky
11/04/2026, 6:50 PMORDER BY than the PRIMARY KEY is a fully supported feature (since v3.0) and should not cause this error. However, practically, it might be the reason why this specific table is hitting the bug while others are not.
Here is the breakdown of why this is likely happening in your 4.1.6 environment:
1. The Design: Decoupling is Legal
StarRocks decouples the Primary Key (for uniqueness) from the Sort Key (for physical storage and prefix indexes).
* Primary Key: Used to find where a row lives so it can be updated.
* Sort Key (ORDER BY): Determines how data is physically arranged inside the .data files.
The engine is designed to handle cases where the physical order does not match the PK index order. This should never trigger an "ordering" error in the storage engine.
2. The Trigger: Why this table is special
The error last_max_rss_rowid > max_rss_rowid means the FE/CN coordination has lost track of the "next available ID" for a tablet. Your table might be hitting this while others don't because:
* Segment Complexity: When ORDER BY differs from the PRIMARY KEY, the data being inserted is physically rearranged before being written to S3. This can change how segments are flushed and how many internal RowID ranges are generated.
* Multi-Partition Pressure: If your insert hits many partitions, the FE has to manage a massive batch of metadata updates. The 4.1.6 bug in the Batch Publish logic is likely tripping over the specific way RowIDs are allocated for this "decoupled" table's segments.
* Concurrency: If you have multiple inserts or compactions happening on this table, the decoupled keys add one more layer of metadata management (mapping PKs to Sort Keys) that might be exposing a race condition in the 4.1.6 code.
3. Does it mean you should change it?
I wouldn't recommend changing your schema yet. Having an optimized ORDER BY is critical for query performance.
Instead, focus on the coordination logic. Since you've already opened GitHub Issue #82332, the maintainers will likely look for a bug in the Lake storage metadata. In the meantime, the most effective "fix" that doesn't involve changing your table design is:
1. Disable FE Batching: This is the most common workaround for "ordering" regressions in 4.1.x.
sql
ADMIN SET FRONTEND CONFIG ("lake_enable_batch_publish_version" = "false");
2. Monitor the Issue: Given this is a 4.1.6 regression, it is likely that 4.1.7 will contain a fix specifically for the max_rss_rowid mismatch.
Summary: Your ORDER BY isn't "wrong," but the extra metadata work it requires might be the "stress test" that is triggering the underlying 4.1.6 bug.
References
• table_design/table_types/primary_key_table.md
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• administration/management/FE_configuration.md
References
• table_design/table_types/primary_key_table.md
• knowledge/usage/best-practice.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• table_design/indexes/Prefix_index_sort_key.mdGregM
11/04/2026, 6:54 PMDecoding the values: 12884901887 = rssid 2, rowid 0xFFFFFFFF; 12884901886 = rssid 2, rowid 0xFFFFFFFE. These are the two sentinels used for the same rssid. PersistentIndexMemtable::erase/erase_with_filter set (del_rssid<<32)|UINT32_MAX for deletes, while LakePersistentIndex::ingest_sst sets (rssid<<32)|(UINT32_MAX-1) for eagerly built SSTs. In this case a memtable SST containing a delete at rssid 2 sits before the ingested SST for segment rssid 2 in _sstable_filesets, so the ordering check in LakePersistentIndex::commit() fails. The ingest path is reached via pk_index_eager_build_threshold_bytes (spilled loads ≥ 100 MB). The same code is unchanged in 4.1.7 and main. I'm testing whether raising pk_index_eager_build_threshold_bytes avoids it for new loads.
and
The table has a separate sort key (ORDER BY (event_time) vs PRIMARY KEY(event_time, row_id)). For such tables, spill_mem_table_sink.cpp forces eager PK-index build regardless of pk_index_eager_build_threshold_bytes, and pk_preserve_txn_delete_order_enabled() is forced on. That combination puts a delete at (rssid<<32)|UINT32_MAX ahead of the ingested SST at (rssid<<32)|(UINT32_MAX-1)."Rocky
11/04/2026, 6:54 PM0xFFFFFFFF (UINT32_MAX).
* Eagerly built SSTs (from spilled loads): use 0xFFFFFFFE (UINT32_MAX - 1).
When your load is large enough to spill (exceeding the 100MB threshold), the engine attempts to "ingest" these SSTs. Because your table has ORDER BY ≠ PRIMARY KEY, the engine is forced into a strict "preserve delete order" mode.
The bug occurs because the engine's "ordering check" expects RowIDs to always increase. However, it is placing the Delete sentinel (higher value) before the Ingested SST sentinel (lower value) in its internal file set. When the engine's commit() function checks the sequence, it sees the value go from ...87 to ...86 for the same rssid, determines the order is corrupted, and throws the sstables are not ordered error.
2. Why the workaround might work
The agent suggested raising pk_index_eager_build_threshold_bytes.
* What this does: By default, if a load generates more than 100MB of data in a single flush, it "spills" and uses the ingest_sst path.
* The Goal: By increasing this threshold (e.g., to 1GB or 2GB), you prevent the engine from entering the "eager build/ingest" code path where the sentinel conflict exists. The data will instead stay in the standard memtable flush path until it is much larger.
3. How to apply the suggested test
You can try applying this setting on your BE nodes (or via SQL if supported for your version) to see if it bypasses the error for new loads:
sql
-- Try setting this at the session or global level if supported,
-- or update be.conf and restart the BEs.
-- Increase from 100MB to 1GB to avoid the 'ingest' path for most loads.
ADMIN SET FRONTEND CONFIG ("pk_index_eager_build_threshold_bytes" = "1073741824");
_(Note: If the above SQL doesn't work, add pk_index_eager_build_threshold_bytes = 1073741824 to your be.conf and restart the BEs.)_
Summary for your GitHub Issue
Since the agent noted that this code is unchanged in 4.1.7 and main, your GitHub issue (#82332) is critical. It points to a flaw in how the engine handles the "decoupled sort key" logic during large, spilled writes.
For now, avoiding the spill path (by increasing the threshold) or matching your ORDER BY to your PRIMARY KEY (if performance allows) are your two primary workarounds while waiting for a code fix in a future 4.1.x patch.
References
• administration/management/BE_configuration.md
• table_design/table_types/primary_key_table.md
References
• table_design/table_types/primary_key_table.md
• faq/Sql_faq.md
• best_practices/primarykey_table.md
• best_practices/table_clustering.mdGregM
11/05/2026, 9:36 PMUPDATE information_schema.be_configs SET value = 'false' WHERE name = 'enable_load_spill';
it appears the spill was causing this?Rocky
11/05/2026, 9:36 PMenable_load_spill = false, you have effectively disabled the code path that uses spill_mem_table_sink.cpp. Here is exactly what was happening and why this change "fixed" it:
1. The Spill Path vs. The Normal Path
* Normal Path (Spill Disabled): Data is buffered in the BE's MemTable. When the MemTable is full, it is flushed directly to a segment. This path uses standard RowID assignment that increments normally.
* Spill Path (Spill Enabled): When a load is large or uses a separate ORDER BY, StarRocks attempts to "spill" intermediate results to disk to save memory. This path triggers an "Eager PK-index build."
2. The Logic Conflict
As the agent noted, the spill path uses a specific logic for "ingesting" SST files. It assigns a sentinel RowID of ...86 to these ingested files. However, because your table has a separate sort key, the engine also generates a "Delete" record with a sentinel RowID of ...87 to ensure data consistency during the sort.
In version 4.1.6, the engine incorrectly places the Delete (87) before the Ingested Data (86). Since 87 is greater than 86, the storage engine's safety check (last_max_rss_rowid > max_rss_rowid) fails, assuming the data has become "unordered."
3. Trade-offs of your fix
While enable_load_spill = false resolves the error, keep the following in mind:
* Memory Usage: Your BE nodes will now use more RAM during large loads because they can no longer offload intermediate data to disk. If you see Memory Limit Exceeded (Process Terminated) errors, you may need to increase the BE mem_limit or reduce the concurrency of your loads.
* Table Design: This confirms that the bug is specifically tied to how "Decoupled Sort Keys" (ORDER BY ≠ PRIMARY KEY) interact with the spill logic.
Recommendation
Since you have a working workaround, you should update your GitHub issue (#82332) with this finding. Mention that:
1. Disabling enable_load_spill on the BE resolved the sstables are not ordered error.
2. This confirms the conflict is within the spill_mem_table_sink.cpp and the eager PK-index build logic.
This information is extremely valuable for the developers to create a create a permanent fix for the sentinel value ordering in the next patch.
References
• administration/management/BE_configuration.md
• administration/management/resource_management/spill_to_disk.md
• sql-reference/System_variable.md
• administration/management/FE_configuration.md