Skip to content
DoK Community

StarRocks on Kubernetes FMEA - Part 2 Running the Experiments

By

In Part 1, we used failure modes and effects analysis (FMEA) to ask what could interrupt StarRocks on GKE. Here we set up the lab, test one fault at a time, and check how the cluster recovers. Read Part 1.

This article is for SREs and Kubernetes engineers who test stateful workloads. We check what the client sees, whether a member rejoins, and whether the table gets all its replicas back.

Set up the lab

We ran StarRocks 3.5.21 in shared-nothing mode on a regional GKE Standard cluster. We used StarRocks Operator 1.11.4. The cluster had three workers, one in each zone. Each worker ran one voting Frontend (FE) and one Backend (BE). Each FE and BE had its own zonal disk.

The worker pool had a fixed size. When we cordoned a worker, Kubernetes had no other worker in that zone for the replacement pod. This let us keep the member unavailable during a test.

StarRocks on GKE architecture from Part 1, showing the Frontend and Backend groups

The StarRocks topology from Part 1. For these tests, we used six 25 GiB volumes.

Use a separate GCP project with billing enabled. Check that it has enough quota for three workers with eight vCPUs each and 300 GiB of SSD capacity. Install OpenTofu, Helm, kubectl, the Google Cloud CLI, and the GKE authentication plugin. Lab setup requirements.

Clone the repository. Sign in to Google Cloud and copy the example variables file.

git clone https://github.com/harsh098/starrocks-gke-fmea.git
cd starrocks-gke-fmea
gcloud auth login
gcloud auth application-default login
cp infra/terraform.tfvars.example infra/terraform.tfvars

In infra/terraform.tfvars, set project_id to your GCP project ID. Set admin_cidr to your public IPv4 address followed by /32.

Create the GKE cluster. Connect to it and install StarRocks with the smaller disk profile. Run the topology and smoke checks before you introduce a fault.

tofu -chdir=infra init
tofu -chdir=infra plan -out=lab.tfplan
tofu -chdir=infra apply lab.tfplan
./scripts/connect.sh
export KUBECONFIG="$PWD/.local/kubeconfig"
SR_VALUES_FILE=deploy/small-storage-values.yaml ./scripts/deploy.sh
./scripts/topology.sh
./scripts/smoke-test.sh

The smoke test creates fmea.events if the table does not exist. Before the first fault, we checked that all three FEs and all three BEs were alive. Each of the four tablets had three healthy replicas.

For the password test, we installed External Secrets Operator (ESO). We set its refresh interval to one hour before the first sync. ESO setup and test procedures.

Invariants in the system

Before each test, we define the conditions the cluster must satisfy during the fault and after recovery. We check these conditions through client responses, StarRocks membership, and tablet replica status.

  1. Crash-Recovery when an FE fails.

    • After we remove the fault, the FE must restart and rejoin the cluster.
    • Its pod must become Ready and stop repeated restarts in CrashLoopBackOff.
    • SHOW FRONTENDS must report all three voting FEs as alive, with exactly one leader.
    • With one voting FE unavailable, the two connected voters must elect or retain a leader and commit valid metadata changes.
    • Metadata changes acknowledged during the fault must remain visible after recovery.
  2. Crash-Recovery when a BE fails.

    • After we remove the fault, the BE must restart and rejoin the cluster.
    • Its pod must become Ready and stop repeated restarts in CrashLoopBackOff.
    • SHOW BACKENDS must report all three BEs as alive.
    • Each affected tablet must return to three healthy replicas on three distinct BEs.
    • ADMIN SHOW REPLICA STATUS must report State = NORMAL, Status = OK, and IsBad = false for every replica.
    • With one BE unavailable, valid writes must succeed when two healthy replicas of every affected tablet can acknowledge them.
    • Every acknowledged test row must remain readable after the BE recovers.
  3. Quorum safety and Split Brain.

    • A metadata change requires participation from at least two of our three voting FEs.
    • An isolated FE must never report a metadata change as committed without that voting majority.
    • A minority-side metadata probe must remain absent after recovery if the client received a rejection before any commit.
    • A timeout leaves the operation’s outcome unknown. We must check the probe after recovery.
    • The cluster must prevent Split Brain. Both sides of a partition must never independently commit conflicting metadata changes.
    • With write_quorum = MAJORITY, each affected tablet requires acknowledgments from at least two of its three replicas.
    • If an affected tablet has fewer than two available replicas, the load must never report success.
    • A stale read from the minority FE is acceptable for this test. It does not demonstrate write availability or a metadata commit.

The partition injects link omission. If an isolated FE acknowledges a metadata commit without a voting majority, it violates quorum safety.

A violation of a required condition means the test fails. We record whether the failure affects safety, availability, or recovery.

  • Safety. Does every acknowledged operation satisfy its quorum rule? Does the cluster prevent Split Brain?
  • Availability. Do valid operations succeed while the required voters and tablet replicas remain available?
  • Recovery. Do the affected members rejoin and restore all tablet replicas? Does recovery require operator intervention?

Test Matrix

We use the invariants above to define each test. Before each fault, we verify three alive FEs, three alive BEs, and three healthy replicas per tablet. We restore this baseline before the next test.

Test areaTest case #TestAssumed failure modePASS criteriaFAIL criteria
FE recoveryFE-1Cordon the follower’s worker and force-delete the follower pod. Attempt a metadata change through a surviving FE. Uncordon the worker and check recovery.FE process Crash-Recovery.The two surviving voters commit the metadata probe. The replacement rejoins. All three FEs are alive with one leader, and the probe remains visible.The connected majority cannot commit the probe, the follower cannot rejoin, or an acknowledged metadata change disappears.
FE recoveryFE-2Cordon the leader’s worker and force-delete the leader pod. Attempt a metadata change through a surviving FE. Uncordon the worker and check recovery.FE process Crash-Recovery and leader election.The surviving voters elect one leader and commit the probe. The former leader rejoins, and the acknowledged probe remains visible.The surviving voters cannot elect a leader or commit metadata, the former leader cannot rejoin, or the acknowledged probe disappears.
FE quorum safetyFE-3Isolate the leader’s zone from the other database pods. Verify connectivity, then attempt distinct metadata changes on both sides and a data write on the majority side. Remove the partition and check recovery.Network partition through link omission.Majority-side metadata and data writes succeed. The minority acknowledges no metadata change, and its probe is absent after recovery. All members and tablet replicas recover.A majority probe fails or disappears after recovery, the minority acknowledges a metadata commit or its probe appears after recovery, or membership and replicas fail to recover.
BE availability and recoveryBE-1Cordon one worker and force-delete its BE pod. Confirm that StarRocks marks the BE down. Insert a unique row, then uncordon and check recovery.BE process Crash-Recovery with one unavailable replica per affected tablet.The insert succeeds with two healthy replicas per affected tablet. The row remains readable after recovery. All three BEs are alive, and every tablet has three healthy replicas on distinct BEs.The insert fails despite two healthy replicas per affected tablet, the acknowledged row disappears, the BE cannot rejoin, or any replica remains unhealthy.
Credential rotationCRED-1Start ESO with a one-hour refresh interval. Rotate the database and provider passwords. Confirm the target Secret is stale, then restart one BE. Record the failure before applying the fix.Credential synchronization delay exposed by BE Crash-Recovery.The replacement BE authenticates and returns to service without a forced sync or another restart. All affected tablets regain three healthy replicas.The replacement BE reads the old password and cannot authenticate or return to service. This is the expected failure of the rotation workflow.
Planned maintenanceSURGE-1Upgrade the GKE worker pool using surge while recording insert acknowledgments and client errors. Verify worker and pod replacement, volume bindings, and tablet health.Rolling worker replacement and FE/BE Crash-Recovery.Every acknowledged insert remains readable. All FEs and BEs rejoin, all affected tablets regain three healthy replicas, and all six database volume bindings remain intact.An acknowledged insert disappears, a member fails to rejoin, a volume binding changes, or tablet redundancy fails to recover.

The cordon and force-delete tests exercise database process Crash-Recovery. Planned worker drain as a standalone test and abrupt worker loss remain open from Part 1. For any client timeout, we check the operation after recovery before we assign its outcome.

FE-1 : Follower recovery

We remove one FE follower and check that the two remaining voters can commit a metadata change. We then let the follower return and verify its membership and stored metadata.

FE-1 test layout

Schematic placement. The runner selects the actual members and zones.

Procedure

  1. Check FE membership and select a follower automatically.
  2. Cordon its worker and force-delete the selected pod.
  3. Wait for StarRocks to mark the follower down.
  4. Create a unique database through a surviving FE.
  5. Uncordon the worker. Verify rejoin, the same PVC claims, and the probe database.

Observations

Run the test from the repository directory.

python3 scripts/run-member-test.py FE-1

Runner summary from the 25 November rerun (20261125T165622Z-fa04ca). The baseline and recovery lines summarize the runner’s smoke checks. FE-1 run record.

Baseline: 3 alive FEs, 3 alive BEs, 12 healthy tablet replicas.
Outage: starrocks-fmea-fe-2 Alive=false.
Client probe: acknowledged.
Readback: acknowledged probe is present.
Leader: starrocks-fmea-fe-0
Recovery: 3 alive FEs, 3 alive BEs, 12 healthy replicas.
Storage: same PVC claims; replacement pod has a new UID.
Status: PASS

In the outage snapshot from SHOW FRONTENDS, the relevant fields were:

FERoleAlive
fe-0LEADERtrue
fe-1FOLLOWERtrue
fe-2FOLLOWERfalse

Status

PASS. The client probe succeeded during the outage, and the database recovered.

FE-2 : Leader recovery

We remove the FE leader and check whether the two remaining voters elect a replacement. We then commit a metadata change and verify the former leader rejoins.

FE-2 test layout

Schematic placement. The runner selects the actual members and zones.

Procedure

  1. Discover the current leader and a surviving FE.
  2. Cordon the leader’s worker and force-delete its pod.
  3. Wait for the old leader to become unavailable.
  4. Create a unique database through a surviving FE.
  5. Uncordon the worker. Check leadership, membership, PVC claims, and the acknowledged metadata.

Observations

Run the test from the repository directory.

python3 scripts/run-member-test.py FE-2

Runner summary from the 25 November run (20261125T165854Z-d79b11). FE-2 run record.

Baseline: 3 alive FEs, 3 alive BEs, 12 healthy tablet replicas.
Outage: starrocks-fmea-fe-2 Alive=false.
Client probe: acknowledged.
Readback: acknowledged probe is present.
Leader: starrocks-fmea-fe-1
Recovery: 3 alive FEs, 3 alive BEs, 12 healthy replicas.
Storage: same PVC claims; replacement pod has a new UID.
Status: PASS

When SHOW FRONTENDS confirmed the former leader was down, it reported these values:

FERoleAlive
fe-0FOLLOWERtrue
fe-1LEADERtrue
fe-2FOLLOWERfalse

We first saw the new leader 9 seconds after the recorded pod deletion. We verified full recovery at 66 seconds, including membership, tablet health, and metadata readback. These times mark when our checks observed each state.

Tip

BDB JE stores replication state in the FE metadata directory, configured through meta_dir and often mounted as fe_meta. A stale FE must catch up with the leader. An invalid BDB JE environment or damaged metadata can prevent the FE from starting or rejoining. Preserve the metadata directory before attempting recovery. StarRocks metadata recovery.

For planned GKE maintenance, we prefer blue-green upgrades over the default surge strategy. Blue-green creates replacement capacity before draining the old pool and provides batch and pool soak periods. Use that time to check FE membership, metadata writes, and tablet recovery before continuing. GKE upgrade strategies.

Blue-green upgrade behavior and metadata corruption remain untested in this lab.

Status

PASS. The client probe succeeded during the outage, and the database recovered.

Identified Risks

A client can lose its connection during a leader handoff and be unsure whether StarRocks accepted a schema change. StarRocks journals schema-change jobs, and several ALTER TABLE operations run asynchronously. If the connection drops, check SHOW ALTER TABLE and the resulting schema before retrying. This test created a database after failover. Recovery of an in-flight schema change needs a separate test. StarRocks 3.5.21 schema-change source · ALTER TABLE reference.

FE-3 : Leader isolation

We isolate the leader’s zone from the other database pods. We check whether the connected majority can commit metadata and what the client sees when it tries the isolated FE. We then restore communication and inspect the committed state.

FE-3 test layout

Schematic placement. The runner selects the actual members and zones.

Procedure

  1. Find the leader and its zone.
  2. Apply the partition. Verify DNS, blocked cross-zone links, and communication between the majority FEs.
  3. Create a unique database from the majority side, then try a different database from the isolated FE.
  4. Insert a unique row from the majority side.
  5. Remove the partition. Check both database names, the row, all members, and tablet replicas.

Observations

Run the test from the repository directory.

bash scripts/run-partition-test.sh

Runner summary from the 25 November rerun (FE-3-20261125T170028Z). The runner isolated fe-1. FE-3 run record.

FE-3: starting baseline and connectivity checks.
Partition: DNS verified; cross-zone connections blocked; majority FEs connected.
Majority metadata probe exit: 0
Minority metadata probe exit: 1
Majority insert exit: 0
Readback: majority database and row present; minority database absent.
Recovery: 3 alive FEs, 3 alive BEs, 12 healthy replicas.
Status: PASS

The minority probe ran through kubectl exec and connected to the SQL port from inside the isolated pod. The client returned this error:

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:9030' (111)

The NetworkPolicy blocked links between pods. The loopback error shows that the local SQL port refused the connection. StarRocks can shut down the former leader on demotion because its in-memory metadata cannot be rolled back. This self-fencing behavior is consistent with what we saw. The run did not capture an FE shutdown log or container exit state to confirm the cause. Kubernetes NetworkPolicy · StarRocks leader transfer design.

Status

PASS for the observed interval. The majority database and row were present after recovery. The minority probe could not connect, and its database was absent.

Identified Risks

DNS and Kubernetes control-plane access remained available. The minority probe ran once, after the connectivity checks and majority DDL. This leaves the interval immediately after isolation unobserved. To test that interval, start timestamped probes on both sides before applying the partition. Use a unique name for each attempt, record the former leader’s FE logs and container exit state, and reconcile all attempted changes after recovery.

BE-1 : Backend availability

We keep one BE unavailable while writing to an existing table. After the BE returns, we check the acknowledged row and every affected tablet replica.

BE-1 test layout

Schematic placement. The runner selects the actual members and zones.

Procedure

  1. Check baseline membership and tablet health.
  2. Cordon the worker and force-delete one BE pod.
  3. Wait for StarRocks to mark the BE down. Capture tablet status.
  4. Insert a unique row while two BEs remain available.
  5. Uncordon the worker. Check BE registration, the row, and three healthy replicas per tablet.

Observations

Run the test from the repository directory.

python3 scripts/run-member-test.py BE-1

Runner summary from the 25 November rerun (20261125T170449Z-71b220). BE-1 run record.

Baseline: 3 alive FEs, 3 alive BEs, 12 healthy tablet replicas.
Outage: starrocks-fmea-be-0 Alive=false.
Client probe: acknowledged.
Readback: acknowledged probe is present.
Recovery: 3 alive FEs, 3 alive BEs, 12 healthy replicas.
Storage: same PVC claims; replacement pod has a new UID.
Status: PASS

We checked the replica states with ADMIN SHOW REPLICA STATUS.

CheckHealthy replicasDEAD replicas
While BE-0 was down84
After recovery120

Status

PASS. The client probe succeeded during the outage, and the database recovered.

Identified Risks

With write_quorum = MAJORITY, each tablet needed two of its three replicas to acknowledge a write. The two surviving BEs already held one replica of each tablet, so they had no eligible destination for a third copy. This left the affected tablets under-replicated until the BE returned. Another eligible BE could also provide a destination for repair. Losing one of the two remaining replicas of any affected tablet would prevent majority writes to that tablet. StarRocks replica management.

CRED-1 : Password rotation

We rotate the root password while ESO polls hourly, then restart one BE before the target Secret updates. We record the failed restart and test recovery after a forced sync.

The BE explicitly needs the current root password in its MYSQL_PWD environment variable to authenticate to the FE and join the cluster. The startup scripts also use this credential for administrative SQL operations during cluster management. Rotating the database password requires updating the Secret and replacing the affected container so it receives the new environment value. StarRocks Operator password rotation guide.

CRED-1 test layout

Schematic placement. The runner selects the actual members and zones.

Procedure

  1. Start ESO with hourly polling and verify the initial password sync.
  2. Rotate the database password and update the provider source.
  3. Confirm the target Secret still has the original password.
  4. Restart one BE. Capture the authentication error and wait for StarRocks to mark it down.
  5. Insert a unique row through the remaining BEs.
  6. Apply the recovery procedure below and verify all replicas.

Observations

Run the test from the repository directory.

bash scripts/run-credential-test.sh

In the 25 November run (CRED-1-20261125T170625Z), the replacement BE read the stale password and failed to authenticate. CRED-1 run record.

ERROR 1045 (28000): Access denied for user 'root' (using password: YES)
Membership: selected BE Alive=false.
Write with two BEs: acknowledged.

Status

FAIL. The BE required operator intervention to return after password rotation.

Identified Risks

A shorter polling interval still leaves a stale Secret window, and is not a permanent fix. In a scenario where an ESO outage occurs during this interval, can also reproduce the same failure mode. Several failed BE restarts can remove write quorum. It is advised to keep backups handy and force sync ESO ExternalSecret as shown below.

Fix

Force ESO to sync after updating the provider. Verify the target Secret, then replace the affected BE container.

The runner requests synchronization with this command.

kubectl -n starrocks annotate externalsecret starrocks-admin-password force-sync="$(date +%s)" --overwrite

It waits until the target Secret matches the new password, then replaces the affected BE.

kubectl -n starrocks delete pod starrocks-fmea-be-0 --wait=false

The runner checks the acknowledged row and all tablet replicas before restoring the original credential.

SURGE-1 : GKE surge upgrade

We upgrade the GKE worker pool while clients write to StarRocks. We track client errors during the handoff, then check whether every acknowledged insert survives and the replacement pods mount their original volumes.

SURGE-1 test layout showing one worker being replaced across three zones

Schematic placement. GKE replaces workers one zone at a time.

Procedure

  1. For a fresh lab, set node_upgrade_strategy = "SURGE" in infra/terraform.tfvars before provisioning. Verify that the pool has maxSurge=1, maxUnavailable=0, and quota for one extra worker. Keep the StarRocks images fixed.
  2. Record the worker, pod, and volume identities. Start one write probe through the FE Service and one through a surviving FE. Track the insert ID and result of every request.
  3. Select a GKE version compatible with the control plane. Upgrade the control plane first if required, then upgrade the worker pool. Confirm that GKE actually replaced the workers.
  4. Compare the acknowledged insert IDs with the recovered table. Check FE and BE membership, tablet replicas, and the original volume bindings.

Observations

Start the collector from the lab repository:

python3 scripts/capture-surge.py \
  --output .local/surge-01 --probe-database fmea_surge_01 --duration 5400

After the collector creates the probe table, start the FE Service client in a separate terminal:

source scripts/common.sh
lab_context
kubectl apply -f experiments/surge-client.yaml
kubectl -n starrocks rollout status deployment/fmea-surge-client
kubectl -n starrocks logs deployment/fmea-surge-client -c client --follow --timestamps

Keep the client logs across pod replacements. In a third terminal, select a supported target version and request the worker upgrade:

source scripts/common.sh
lab_context
read -r -p 'Target GKE version: ' target_version
gcloud container clusters upgrade "$("$TF" -chdir=infra output -raw cluster_name)" \
  --node-pool experiments --cluster-version "$target_version" \
  --region "$("$TF" -chdir=infra output -raw region)" \
  --project "$("$TF" -chdir=infra output -raw project_id)"

After recovery, stop the probes and confirm the lab baseline:

kubectl -n starrocks scale deployment/fmea-surge-client --replicas=0
touch .local/surge-01/STOP
./scripts/smoke-test.sh

The 21 November run upgraded GKE from 1.36.4-gke.2377000 to 1.36.5-gke.1259000. The table summarizes the recorded observations. SURGE-1 run record · Full procedure and reconciliation.

CheckObserved result
Worker and pod replacementAll 3 workers and 6 StarRocks pods replaced. StarRocks images unchanged.
Leader handoffFE-1 took over from FE-2. FE-2 rejoined as a follower.
Acknowledged insertsAll 279 remained readable. The FE Service client acknowledged 192 and the exec probe acknowledged 87.
Direct insert errorsTwo requests failed during the handoff. Neither insert ID appeared after recovery.
Storage and replicasAll 6 volume bindings stayed intact. All 3 FEs and 3 BEs returned, with 12 healthy baseline replicas and 3 healthy probe replicas.

Status

PASS for write retention and recovery. The upgrade preserved every acknowledged insert and restored all members and replicas. The two failed requests exposed a brief availability impact during the handoff.

Identified Risks

An existing three-replica table can accept majority writes with two healthy copies per tablet. Creating a new three-replica table still requires three eligible BEs. In this run, two create attempts were rejected while only two BEs were alive, and another DDL attempt failed with a closed connection. Check the outcome of a timed-out request before retrying.

Conclusion

These tests let us examine Safety, Availability, and Recovery separately. The cluster continued through a single-member outage and recovered its replicas. Password rotation exposed a gap in how we coordinated the database credential, ESO, and container restarts.

Safety

The connected FE majority committed metadata changes during the partition. At the time of the minority probe, the former leader’s loopback SQL port refused the connection. We found no minority probe database after recovery.

The acknowledged inserts remained readable after recovery, including all 279 from the surge upgrade.

Availability

The cluster accepted metadata writes with one voting FE unavailable. When the leader disappeared, the remaining voters elected a replacement. Existing-table writes also succeeded with one BE down and two replicas available per affected tablet.

During the surge upgrade, two direct inserts failed during the leader handoff. Creating a new three-replica table also depended on having three eligible BEs available.

Recovery

Successful recovery required more than a Ready pod. We checked FE and BE membership, read back acknowledged writes, and verified three healthy replicas for each affected tablet.

CRED-1 failed because the replacement BE read a stale password and could not authenticate. We forced ESO to sync, verified the target Secret, and replaced the affected BE. Registration and all twelve tablet replicas recovered. This coordination must be part of the password-rotation procedure.

Final Verdict

  1. Ready for production for our analytical workload. Our verdict combines these lab findings with seven months of production experience. It depends on the deployment’s quorum, placement, credential management, and recovery procedures.

  2. Upgrades need a scale-up and scale-down plan. Make replacement capacity available in the disk’s zone before removing a worker. Replace members in controlled steps. Check membership and tablet health before proceeding.

  3. Reserve two to three minutes for possible service interruption during GKE maintenance. This is our operating allowance for this workload. The lab leader-restart run verified full recovery in 66 seconds. Separately, in our production experience, service became available again within roughly two to three seconds after the interruptions we encountered. For planned upgrades, we prefer blue-green for the time it gives us to check recovery between batches.

  4. Use batch ingestion and a replayable source. For analytical workloads, prefer batch writes through Stream Load. Its asynchronous Merge Commit mode can accept data before the merged transaction finishes, so verify the final transaction status. For continuous ingestion, Kafka with Routine Load provides an asynchronous path. Keep source data long enough to replay batches during recovery, and design retries to avoid duplicate rows. Stream Load, Kafka Routine Load.