Repository navigation
Conversation
Lowering starRocksFeSpec.replicas only shrinks the StatefulSet. The removed FE stays in SHOW FRONTENDS as a dead BDBJE group member, which blocks BDBJE journal cleanup until fe-meta runs out of disk (#789). Once the scale-in has settled, the FE controller now drops each frontend that belonged to a removed pod, is not alive and is not the leader, and deletes that pod's FE meta PVC first so a later scale-out can rejoin with an empty meta dir. The FE SSL helpers move from cn to fe (cn imports fe). Signed-off-by: Mohith26 <109003762+Mohith26@users.noreply.github.com>
Mohith26
force-pushed
the
fe-scale-in-drop-frontends
branch
from
November 4, 2026 03:52
12e5b4b to
83820d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #789. Lowering
starRocksFeSpec.replicasonly shrinks the FE StatefulSet. The removed FE stays inSHOW FRONTENDSas a dead BDBJE group member, which blocks BDBJE journal cleanup, sofe-metagrows until FE runs out of disk (4.8 GB of.jdbfiles and a CrashLoopBackOff in the issue).This does for FE what #663/#714 do for CN. At the end of
SyncCluster(skipped in disaster recovery mode), once the scale-in has settled (the StatefulSet matches the expected one and runs exactlyreplicaspods, all ready, on the update revision, with ordinals 0..replicas-1), the FE controller runsSHOW FRONTENDSand drops every frontend that:<sts>-<n>.<search svc>.<ns>.) withn >= replicas,It uses
ALTER SYSTEM DROP FOLLOWERorDROP OBSERVERbased on the role. If the in-range pods do not all show up by FQDN, it does nothing, so FEs added by hand, other StatefulSets and non-FQDN setups are never touched. Like the CN cleanup, failures are logged and retried on the next reconcile.One extra step: before the DROP it deletes the removed pod's FE meta PVC (the volume claim template mounted at the FE meta dir). StatefulSets keep PVCs on scale-in, and a dropped FE cannot rejoin with its old meta (StarRocks requires an empty meta dir plus
--helper). Without this, scaling 3 to 2 and later back to 3 would leave fe-2 crash looping. With an empty meta volume,fe_entrypoint.shtakes thestart_fe_no_metapath and runsALTER SYSTEM ADD FOLLOWERitself. Deleting first keeps both steps retryable: a NotFound PVC is ignored, and the frontend stays listed until the DROP succeeds. This needsdeleteonpersistentvolumeclaims, added to the ClusterRole, Role,config/rbacanddeploy/operator.yaml. Only delete is needed because the PVC is deleted by name, not listed through the cache. I'm happy to put the PVC part behind a flag if you'd rather keep it opt-in.The SSL helpers (
cn_mysql_ssl.go) moved unchanged to the fe package, since cn already imports fe and the FE controller needs the same--fe-ssl-modehandling.doc/scale_in_fe_nodes_howto.mdnow describes the automatic step and keeps the manual procedure.How I tested: unit tests with sqlmock and the fake client for the parsing, selection rules, PVC cleanup, retry after a failed DROP, and every not-settled case (no SQL is sent and nothing is deleted). I also ran the full
make testpackage list with envtest 1.25,golangci-lintv2.2.2 (0 issues) andhelm templateon the chart. I haven't run it against a live StarRocks cluster.Related Issue(s)
#789
Checklist
For operator, please complete the following checklist:
make generateto generate the code. (no API changes)make lintto check the code style.make testto run UT.make manifeststo update the yaml files of CRD. (no CRD changes; RBAC files updated by hand)For helm chart, please complete the following checklist:
file of starrocks chart. (no values changes)
scriptsdirectory, runbash create-parent-chart-values.shto update the values.yaml file of the parentchart( kube-starrocks chart). (not needed)