Skip to content

[BUG] Scaled-in CN are never deregistered from FE in shared_nothing mode → dead "ghost" compute nodes accumulate #775

Open

Description

@silverflow

Describe the bug

When the cluster runs in shared_nothing mode but uses Compute Nodes (CN) with autoscaling (autoScalingPolicy → operator-created HPA), the operator never deregisters CN from the FE on scale-in.

The CN→FE reconciliation SyncComputeNodesInFE is gated to shared-data mode only — in SyncCnSpec (pkg/subcontrollers/cn/cn_controller.go):

// only take effect for shared-data mode
if !fe.IsRunInSharedDataMode(feconfig) {
    return nil
}

So in shared_nothing mode the drop logic added in #663 (and fixed in #714) is never reached. Every CN removed by a scale-down stays registered in the FE as Alive: false with ErrMsg: java.net.UnknownHost (its pod FQDN no longer resolves), and these accumulate up to maxReplicas. Consequences:

  • fe.warn.log floods with failed to get right ip by fqdn kube-starrocks-cn-<N> at tens–hundreds of lines/sec.
  • The query planner intermittently routes to these dead nodes and fails with ANALYSIS_ERR (queries never execute; Time=0-1ms), causing intermittent failures for clients that query via CN (e.g. Tableau extracts).

This is the shared_nothing counterpart of #713. The database side intentionally delegated CN deregistration to the operator in StarRocks/starrocks#62915 — but the operator only performs it in shared-data mode.

Note (for a complete fix): even if the shared-data gate is removed, the drop groups nodes by a WarehouseName column (ComputeNodesByWarehouse[...] in cn_mysql.go) and looks up "default_warehouse". In shared_nothing mode SHOW COMPUTE NODES does not return a WarehouseName column, so the lookup is empty and the drop loop still won't fire. A robust fix should handle the absence of warehouse info (treat all CN as one group) and drop with ALTER SYSTEM DROP COMPUTE NODE "<host>:<port>" (no FROM WAREHOUSE clause).

To Reproduce

Steps to reproduce the behavior:

  1. Deploy kube-starrocks with FE + BE + CN. run_mode defaults to shared_nothing (no run_mode in fe.conf).
  2. Enable CN autoscaling: set starRocksCnSpec.autoScalingPolicy (the operator creates the CN HPA).
  3. Scale CN up, then down — via the HPA or by changing min/max (e.g. 2 → 15 → drain back to 5).
  4. Connect to the FE and run SHOW COMPUTE NODES.

Observed:

  • Removed CN remain listed with Alive=false, SystemDecommissioned=false, ErrMsg=java.net.UnknownHost, and a frozen LastHeartbeat; they are never removed.
  • Example: 20 registered / 5 actually running / 15 dead "ghost" nodes (cn-5..cn-19), the dead set capped at maxReplicas.
  • FE log floods continuously: failed to get right ip by fqdn kube-starrocks-cn-17....
  • Operator logs show no DROP COMPUTE NODE / FE-connection activity for CN (only routine reconcile).
  • Manually running ALTER SYSTEM DROP COMPUTE NODE "<fqdn>:<heartbeat_port>" removes them and immediately stops the FQDN-resolution flood — confirming the FE entries are stale and should have been dropped by the operator.

Expected behavior

The operator should deregister scaled-in CN from the FE in shared_nothing mode as well — it already manages the CN StatefulSet and HPA in this mode, so leaving the FE membership uncleaned is inconsistent. Either:

Today, SyncComputeNodesInFE returning early for non-shared-data clusters leaves dead CN registered indefinitely.

Please complete the following information

  • Operator Version: v1.11.4
  • Chart Name: kube-starrocks
  • Chart Version: v1.11.4
  • Additional: StarRocks CURRENT_VERSION() = branch-4.1-… (chart appVersion label 3.5-latest); run_mode=shared_nothing; single FE; CN autoscaling via autoScalingPolicy.

Activity

  1. added
    bug
    on Jun 30, 2026
  2. digitalpoetry commented on Sep 16, 2026

    @digitalpoetry
    Contributor

    👋 Thanks for the detailed issue report and investigation. I've attempted a fix in #802

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions