Zurab Kiknavelidze
08/10/2026, 11:02 AMRocky
08/10/2026, 11:02 AM-g flag:
* stop_fe.sh -g
* stop_be.sh -g
* What happens:
* The node immediately stops accepting new queries or fragments.
* It waits for ongoing queries to complete within a controlled time window.
* FE Behavior: Follower FEs wait for active sessions to finish (default timeout 60 seconds).
* BE Behavior: BEs wait for existing query fragments to finish (default timeout is 20 seconds, controlled by loop_count_wait_fragments_finish).
2. Impact Based on Query Duration
Even with Graceful Exit, the impact depends on how long your queries run:
* Short queries (< 20s): Typically complete normally without failure.
* Medium queries (20s - 60s): Should complete if you have tuned the wait timeouts, otherwise they may be cancelled and require a retry.
* Long queries (> 60s): These are likely to be terminated if they exceed the maximum graceful wait window.
3. Version Considerations
* v3.4 and later: This is the most stable version for rolling updates. The FE is "aware" that a BE is in an "exiting" state and won't prematurely mark it as dead, allowing for a smoother transition.
* v3.3: Graceful exit exists but has some limitations where the FE might still mark a BE as dead prematurely, potentially failing some queries.
* Before v3.3: StarRocks does not have a formal graceful exit. Stopping a node will likely fail any queries currently being processed by that specific node.
Summary of Best Practices
1. Upgrade to v3.4+ for the best rolling update experience.
2. Use stop_be.sh -g and stop_fe.sh -g during your update process.
3. Check for long-running queries before starting the update, as these are the most likely to fail if they exceed the graceful timeout.
4. Use a Load Balancer (like F5 or HAProxy) in front of your FEs so that when an FE enters graceful exit (returning HTTP 500 on its health check), the balancer stops sending new traffic to it immediately.
References
• administration/management/graceful_exit.md
• administration/management/BE_configuration.md
• faq/Sql_faq.md
• using_starrocks/caching/query_cache.mdZurab Kiknavelidze
08/10/2026, 11:03 AMRocky
08/10/2026, 11:04 AM/opt/starrocks/fe_prestop.sh (sends SIGUSR1 to trigger graceful exit).
* BE/CN: /opt/starrocks/be_prestop.sh (sends SIGTERM to trigger graceful exit).
2. Graceful Exit Phase:
* The node stops accepting new query fragments.
* It waits for ongoing fragments to finish.
* FE Awareness (v3.4+): The Frontend is informed that the Backend is "Exiting." It will wait for the BE to finish its work rather than immediately marking it as DEAD and failing the query.
3. Termination Grace Period: By default, the operator sets terminationGracePeriodSeconds to 120 seconds. If the queries don't finish within this window, Kubernetes will forcibly kill the pod (SIGKILL), and those queries will fail.
Will my queries fail?
It depends on the StarRocks Version and Query Duration:
StarRocks Version | Impact on Queries
v3.4 and later | Best Experience. Supports extended wait windows. FE knows the BE is exiting and won't kill the query prematurely. Most queries under 60-120s will succeed.
v3.3 | Basic Support. Has some "flaws" where the FE might still mark a BE as DEAD after ~15s of heartbeat failure, potentially failing mid-length queries.
Before v3.3 | High Risk. Rolling updates will likely fail any query currently being processed by the pod being restarted.
Recommendations for Helm Users
To ensure the smoothest rolling update in K8S:
1. Check Version: Ensure you are running v3.4.0 or later.
2. Adjust Grace Period: If you have very long-running queries (e.g., 5-minute ETLs), increase the terminationGracePeriodSeconds in your StarRocksCluster CR or Helm values to be longer than your longest query.
yaml
# Example snippet for Helm values.yaml
starrocksCluster:
beSpec:
terminationGracePeriodSeconds: 300 # 5 minutes
3. BE Configuration: For v3.4.5+, ensure graceful_exit_wait_for_frontend_heartbeat is set to true (it allows the BE to confirm the FE has seen its exit status before shutting down).
4. Use a Service/Load Balancer: Ensure your application connects to the FE via a Kubernetes Service. During a rolling update, the FE pre-stop hook makes the FE return HTTP 500 on its health check, causing the K8S Service to stop routing new traffic to it ~15 seconds before it actually shuts down.
References
• administration/management/graceful_exit.md
• starrocks-kubernetes-operator/doc/api.md
• administration/management/BE_configuration.md
• quick_start/helm.md
References
• administration/management/graceful_exit.md
• quick_start/helm.mdZurab Kiknavelidze
08/10/2026, 12:07 PMRocky
08/10/2026, 12:07 PMstarrocksCluster: componentValues in your Helm values.yaml is a global configuration block used to apply settings to all StarRocks components (FE, BE, and CN) simultaneously.
When you see "3.5.15" associated with it, it refers to the StarRocks version (image tag) you are deploying.
1. What does it do?
Instead of manually defining the same settings (like image repository, tag, or resource limits) inside individual starrocksFESpec and starrocksBeSpec blocks, you can define them once under componentValues. This ensures your entire cluster stays on the same version and shares the same base configuration.
2. Correct Syntax
In most versions of the StarRocks Helm chart, componentValues is an object, not a single string. If you want to set the version to 3.5.15 globally, your values file should look like this:
yaml
starrocks:
starrocksCluster:
componentValues:
image:
tag: "3.5.15"
3. Precedence Rules
* Centralized Control: Settings in componentValues apply to FE, BE, and CN.
* Specific Overrides: If you define a setting inside a specific component spec (e.g., starrocksFESpec.image.tag), it will overwrite the global value in componentValues for that specific component.
* Non-Merging: Note that if you define a setting in the component spec, it usually replaces the corresponding section in componentValues rather than merging with it.
4. About Version 3.5.15
StarRocks v3.5.15 is a stable patch release in the 3.5 LTS (Long Term Support) branch. In the context of your previous question about rolling updates:
* Using 3.5.15 via this field ensures that all nodes are updated to the same patch version during the Helm upgrade.
* Because it is a version higher than v3.4, it fully supports the Graceful Exit and FE-Awareness features discussed earlier, making your rolling update via Helm very safe for ongoing queries.
References
• quick_start/helm.md
• administration/management/graceful_exit.md
• administration/management/BE_configuration.md
• faq/Sql_faq.md
• using_starrocks/caching/query_cache.md
References
• quick_start/helm.mdZurab Kiknavelidze
08/10/2026, 12:31 PMRocky
08/10/2026, 12:31 PMcomponentValues for the version in the first step. componentValues acts as a global default—if you set it to 3.5.16, the Operator will see that all components need an update and will start the process for everyone.
Step-by-Step Approach (Manual Sequence)
Step 1: Upgrade CN and BE only
In your values.yaml, keep the FE version at 3.5.15 and explicitly set the CN/BE to 3.5.16.
yaml
starrocks:
starrocksBeSpec:
image:
tag: "3.5.16"
starrocksCnSpec:
image:
tag: "3.5.16"
starrocksFESpec:
image:
tag: "3.5.15" # Keep old version
Run helm upgrade. Wait for all BE/CN pods to reach the Running state and for the Operator to show the cluster as running.
Step 2: Upgrade FE
Once BEs are stable, update the FE tag in your `values.yaml`:
yaml
starrocks:
starrocksFESpec:
image:
tag: "3.5.16"
Run helm upgrade again.
3. Alternative: Let the Operator handle it
The StarRocks Operator is "smart." If you update all versions to 3.5.16 at once in a single `helm upgrade`:
1. The Operator detects the changes.
2. It is programmed to follow the correct lifecycle (it will typically start with BEs/CNs).
3. However, for production environments where you want zero-downtime and maximum control over query impact, the Step-by-Step manual approach above is preferred.
Important Configuration Note
If you are using componentValues, it is usually used like this to avoid repetition:
yaml
starrocks:
starrocksCluster:
componentValues:
image:
repository: starrocks/be-ubuntu # Example
If you put tag: "3.5.16" here, it will apply to everything immediately. To stagger the upgrade, define the tags inside starrocksBeSpec, starrocksCnSpec, and starrocksFESpec individually as shown in the Step-by-Step guide.
References
• deployment/upgrade.md
• deployment/sr_operator.md
• quick_start/helm.md
• administration/management/BE_configuration.md
• faq/Deploy_faq.md
References
• deployment/sr_operator.md
• deployment/upgrade.mdZurab Kiknavelidze
08/10/2026, 1:41 PMRocky
08/10/2026, 1:41 PMhelm upgrade and change the version tags for both FE and BE at the same time, Helm simply updates the StarRocksCluster resource in Kubernetes. The StarRocks Operator then sees that both the FE and BE "desired states" have changed and will likely start updating both groups at the same time.
Why you should do it manually (2-Step Process)
Even though the Operator manages the rolling update of pods within a group (e.g., updating BE-0, then BE-1, then BE-2), it does not strictly enforce that the BE group must finish before the FE group starts unless you stagger the configuration changes.
To minimize issues, follow this "staggered" Helm approach:
Step 1: Upgrade BEs and CNs first
Update only the BE and CN tags in your values.yaml.
* Why: BEs are backward compatible. A new BE can talk to an old FE Leader without issues.
* Action:
yaml
starrocksBeSpec:
image: { tag: "3.5.16" }
starrocksFESpec:
image: { tag: "3.5.15" } # Keep old version for now
* Command: helm upgrade <release-name> starrocks/kube-starrocks -f values.yaml
* Check: Wait until kubectl get pods shows all BEs/CNs are Running and healthy.
Step 2: Upgrade FEs
Once the backends are stable on the new version, update the FE tag.
* Why: FEs are the "brain." If you upgrade them first, they might send new commands or metadata formats that the older BEs don't understand, causing query failures.
* Action: Change starrocksFESpec tag to "3.5.16".
* Command: helm upgrade <release-name> starrocks/kube-starrocks -f values.yaml
Summary of Component Order
1. CN/BE Nodes: Any order.
2. Follower FE Nodes: One by one.
3. Leader FE Node: Always last. (The Operator usually handles the internal FE order correctly, but it cannot know when you want to "start" the FE phase vs. the BE phase unless you separate the Helm calls).
Is there a "Global" way?
If you set the version in starrocksCluster.componentValues, it applies to all components immediately. If you use this field, the Operator will likely trigger updates for FE, BE, and CN simultaneously, which increases the risk of query interruption during the period where the versions are mismatched. For production, the 2-step manual tag update is the safest approach.
References
• deployment/upgrade.md
• deployment/sr_operator.md
• administration/management/graceful_exit.md
References
• deployment/upgrade.md
• deployment/sr_operator.md
• administration/management/graceful_exit.md
• quick_start/helm.md
• administration/management/BE_configuration.md
• faq/Deploy_faq.md
• deployment/upgrade.md
• deployment/sr_operator.md
• administration/management/graceful_exit.md
• quick_start/helm.md
• administration/management/BE_configuration.md
• faq/Deploy_faq.md
References
• deployment/upgrade.md
• deployment/sr_operator.mdRocky
08/10/2026, 1:41 PMZurab Kiknavelidze
08/10/2026, 1:44 PMRocky
08/10/2026, 1:44 PMZurab Kiknavelidze
08/10/2026, 1:46 PMRocky
08/10/2026, 1:46 PMfe-2 -> fe-1 -> fe-0), you can use the "Restart" method.
How to move Leadership to fe-0
1. Check the current Leader:
Run this in your SQL client:
sql
SHOW FRONTENDS;
Look at the Role column to see which node is LEADER.
2. Force a Re-election:
If fe-2 or fe-1 is the leader, delete that pod. Kubernetes will immediately restart it, but in the few seconds it is down, the remaining FEs will hold an election.
bash
# If fe-2 is the leader:
kubectl delete pod <fe-2-pod-name> -n <namespace>
3. Verify and Repeat:
Wait for the deleted pod to come back and show as Alive: true in SHOW FRONTENDS;. If the leader is still not fe-0, repeat the process for the current leader until fe-0 wins the election.
Why this matters for your Upgrade
By making fe-0 the leader, you align the "Leader Last" rule with the default behavior of Kubernetes StatefulSets:
* Default K8s Order: Kubernetes typically updates pods in reverse order: fe-2, then fe-1, then fe-0.
* The Result: Your Followers (fe-2 and fe-1) will be upgraded first while the Leader (fe-0) remains on the old version. Only when the followers are healthy and running the new version will Kubernetes finally reach fe-0.
Summary of the "Safe" Rolling Upgrade
1. Staggered Tags: Use the 2-step Helm approach (CN/BE first, then FE) as discussed.
2. Leadership check: Ensure the node that Kubernetes will update last (usually fe-0) is the current Leader before you update the FE image tag in Helm.
3. Monitor: After running helm upgrade, watch the pods. If a follower fails to start, do not proceed to the next node.
References
• faq/operation_maintenance_faq.md
• deployment/upgrade.md
• administration/Meta_recovery.md
• deployment/deploy_manually.md
• administration/management/graceful_exit.md
References
• faq/operation_maintenance_faq.md
• deployment/upgrade.md
• administration/Meta_recovery.md
• deployment/deploy_manually.md
• administration/management/graceful_exit.md
• faq/operation_maintenance_faq.md
• deployment/upgrade.md
• administration/Meta_recovery.md
• deployment/deploy_manually.md
• administration/management/graceful_exit.md
• faq/operation_maintenance_faq.md
• deployment/upgrade.md
• administration/Meta_recovery.mdZurab Kiknavelidze
08/10/2026, 1:47 PMRocky
08/10/2026, 1:47 PMfe-2, then fe-1, and finally fe-0). Because StarRocks requires the Leader to be upgraded last, you should ensure that fe-0 is the Leader before you start the upgrade.
If fe-2 or fe-1 is the Leader when you trigger the upgrade, Kubernetes will kill and upgrade that Leader pod first, which could cause metadata synchronization issues with the older followers.
How to ensure a safe Operator upgrade
1. Check current leadership
Run the following SQL command in your StarRocks cluster:
sql
SHOW FRONTENDS;
Check the Role column. If fe-0 is the LEADER, you are ready to upgrade.
2. Move the Leader to fe-0 (if necessary)
If another node (like fe-2) is the Leader, you can force it to step down:
1. Delete the current Leader pod:
bash
kubectl delete pod <name-of-leader-pod> -n <namespace>
2. Wait for a new election: The remaining FE pods will elect a new leader.
3. Repeat: Check SHOW FRONTENDS; again. If fe-0 isn't the leader yet, delete the pod that is currently the leader until fe-0 wins the election.
3. Trigger the Helm upgrade
Once fe-0 is the Leader, update your values.yaml and run:
bash
helm upgrade <release-name> starrocks/kube-starrocks -f values.yaml
Kubernetes will now upgrade fe-2 (Follower), then fe-1 (Follower), and finally fe-0 (Leader), which perfectly follows the StarRocks safety requirement.
Does the Operator handle this automatically?
The Operator manages the rolling update process, but it relies on the underlying Kubernetes StatefulSet controller for the pod restart sequence. It does not currently "re-index" the pods or manually swap leadership roles to match the update order. Therefore, ensuring fe-0 is the Leader is the recommended manual "pre-flight" check for a production upgrade.
References
• deployment/upgrade.md
• deployment/sr_operator.md
• faq/operation_maintenance_faq.md
• administration/Meta_recovery.md
References
• faq/operation_maintenance_faq.md
• deployment/upgrade.md
• administration/Meta_recovery.md
• deployment/deploy_manually.mdZurab Kiknavelidze
08/10/2026, 1:50 PMRocky
08/10/2026, 1:50 PMvalues.yaml at once and run helm upgrade, the Operator will attempt to update all components. While the Operator tries to be safe, it does not strictly guarantee that it will finish all CNs before starting the first FE unless you stagger the updates.
Step 1: Upgrade CN/BE only
Update your values.yaml with only the new CN and BE image tags. Leave the FE image tag on the old version.
yaml
starrocksBeSpec:
image: starrocks/be-ubuntu:3.x.x # New Version
starrocksCnSpec:
image: starrocks/be-ubuntu:3.x.x # New Version
starrocksFeSpec:
image: starrocks/fe-ubuntu:2.x.x # KEEP OLD VERSION
Run helm upgrade. Wait for all CN and BE pods to reach the Running and Ready state.
Step 2: Upgrade FE (with Leader check)
Once the CNs and BEs are healthy:
1. Check Leadership: Run SHOW FRONTENDS; and ensure fe-0 is the Leader (as discussed previously, since Kubernetes upgrades fe-2 -> fe-1 -> fe-0).
2. Update FE tag: Now update the FE image tag in your values.yaml.
yaml
starrocksFeSpec:
image: starrocks/fe-ubuntu:3.x.x # New Version
3. Apply: Run helm upgrade again.
Why manually stagger?
* Heartbeat Compatibility: A new BE/CN can always talk to an old FE. However, an old BE/CN might not correctly handle new protocol features or metadata formats sent by a newer FE.
* Operator Logic: By default, the StarRocks Operator treats each component's specification independently. While there is an internal flag in some versions to make BEs wait for FEs to be "Ready" (waitFeReady), this is primarily for fresh installs to ensure BEs have a leader to register with. It does not automatically enforce the "CN first, FE last" rule for version upgrades.
Summary
Yes, you should update the CN/BE values first, apply the change, verify they are healthy, and only then update the FE values. This is the standard "Best Practice" for production StarRocks clusters on Kubernetes.
References
• deployment/upgrade.md
• deployment/sr_operator.md
• administration/management/graceful_exit.md
• faq/operation_maintenance_faq.md
References
• deployment/upgrade.md
• deployment/sr_operator.md
• deployment/downgrade.md