starrocks/starrocks-debug-skills/balance
Claude Code and agent skill by starrocks/starrocks-debug-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when the tablet scheduler is unhealthy: replicas are missing, clone tasks are failing or timing out, balance is too slow (disk usage skewed) or too aggressive (impacting imports), BE decommission is stuck, or colocate groups are unstable. Covers SHOW PROC /cluster_balance analysis, fe_tablet_schedules system table, clone slot tuning, and decommission unblocking via recycle-bin and replica count checks.
Install
npx vskill@latest install starrocks/starrocks-debug-skills/balanceSKILL.md
Balance & Tablet Scheduler Troubleshooting
Investigation guide for tablet scheduling, cluster balance, replica repair, and decommission issues.
Five root causes account for the vast majority of cases:
- Cause A — balance throughput too low (clone tasks not progressing)
- Cause B — balance too aggressive (impacting writes and queries)
- Cause C — decommission BE stuck (replicas cannot be relocated)
- Cause D — clone task repeated failure (destination path or disk issues)
- Cause E — colocate group unstable (group marked Unstable, balance loops)
Metric Taxonomy — Read This First
Before using any metrics, understand the two-layer structure:
FE-level metrics (aggregated, cross-node)
| Metric name | Meaning | |
|---|---|---|
starrocks_fe_scheduled_tablet_num | Total tablets currently being scheduled (pending + running) | |
starrocks_fe_scheduled_pending_tablet_num{type="BALANCE"} | Tablets waiting for a balance clone slot | |
starrocks_fe_scheduled_pending_tablet_num{type="REPAIR"} | Tablets waiting for a repair clone slot | |
starrocks_fe_scheduled_running_tablet_num{type="BALANCE"} | Balance clone tasks actively running | |
starrocks_fe_scheduled_running_tablet_num{type="REPAIR"} | Repair clone tasks actively running | |
starrocks_fe_clone_task_total | Cumulative clone tasks submitted | |
starrocks_fe_clone_task_success | Cumulative clone tasks completed successfully | |
starrocks_fe_clone_task_copy_duration_ms{type="INTER_NODE"} | Clone task copy duration for inter-node balance | |
starrocks_fe_clone_task_copy_bytes{type="INTER_NODE"} | Bytes copied per clone task |
BE-level metrics (per-node)
| Metric name | Meaning | |
|---|---|---|
starrocks_be_clone_task_copy_bytes{type="INTER_NODE"} | Bytes transferred per clone on this BE | |
starrocks_be_clone_task_copy_duration_ms{type="INTER_NODE"} | Clone duration on this BE | |
starrocks_be_engine_requests_total{status="failed",type="clone"} | Failed clone requests on this BE |
SQL observability
Key SHOW PROC "/statistic" fields:
| Field | Meaning | |
|---|---|---|
UnhealthyTabletNum | Tablets with missing replicas, incomplete versions, colocate mismatch, or location mismatch | |
InconsistentTabletNum | Tablets with data inconsistency across replicas | |
CloningTabletNum | Tablets currently being cloned | |
ErrorStateTabletNum | Tablets in error state (PK tables only) |
Key SHOW PROC "/cluster_balance" sub-paths:
| Sub-path | Meaning | |
|---|---|---|
cluster_load_stat | Disk usage and tablet count per BE by medium type | |
working_slots | Available/total clone slots per BE path | |
sched_stat | Scheduler statistics snapshot (updated every 20s) | |
priority_repair | Tablets needing priority repair | |
pending_tablets | Tablets waiting for scheduling | |
running_tablets | Tablets currently being cloned | |
history_tablets | Recently completed tablets (max 1000, includes ErrMsg) | |
balance_stat | Balance overview by balance type (3.5+) |
How to retrieve metrics
Option 1 — curl the FE HTTP port (immediate, no Prometheus needed)
Option 2 — curl the BE HTTP port (per-node clone health)
Option 3 — SQL (primary method for balance diagnosis)
Default HTTP ports: BE = 8040, FE = 8030. Verify with SHOW BACKENDS or be.conf / fe.conf.
Key rules for interpretation:
UnhealthyTabletNum > 0is the primary alert signal. Drill intoSHOW PROC "/statistic/<db_id>"to identify which databases are affected.CloningTabletNum> 0 withUnhealthyTabletNumdecreasing means repair is in progress — expected behavior. Only investigate ifCloningTabletNumis stuck.starrocks_fe_clone_task_successshould be rising. Ifclone_task_totalrises butclone_task_successdoes not, clone tasks are failing — checkhistory_tablets.ErrMsg.- Disk usage difference > 10% between BEs (
SHOW BACKENDS:DataUsedCapacity) triggers disk balance clones automatically. working_slotsall zero or all full: zero means no work; all full means scheduler is at capacity — check if tablets are actually moving by watchingCloningTabletNum.
Balance Health Reference
| Metric / Phenomenon | Healthy | Needs Attention | Act Immediately | |
|---|---|---|---|---|
UnhealthyTabletNum | 0 | 1–100 (and decreasing) | > 100 sustained or not decreasing | |
CloningTabletNum | 0 (no activity) or rising then falling | Stuck at same value > 10 min | Stuck with ErrMsg in history_tablets | |
| Disk usage difference between BEs | < 10% | 10–20% | > 20% (balance triggered automatically) | |
| Tablet count difference between BEs (same partition) | 0–1 | 2–5 | > 5 (imbalanced scans) | |
clone_task_total rate vs clone_task_success rate | Equal | Success rate < 90% | Success rate < 50% | |
working_slots fill rate | 20–80% | > 95% (saturated) | 100% with tasks still pending > 30 min |
Phase 1 — Confirm Balance / Repair Issue
Step 1.1 — Quick cluster health signal
Key interpretation:
UnhealthyTabletNum = 0across all DBs → cluster is healthy, no action neededUnhealthyTabletNum > 0→ proceed to Step 1.2CloningTabletNum > 0→ repair/balance is in progress; check if it's making progress
Step 1.2 — Classify the issue type
Check the Increase column to see if counters are advancing:
| Observation | Points toward | |
|---|---|---|
num of balance scheduled rising, UnhealthyTabletNum shrinking | Balance is working; just slow — Cause A | |
num of clone task failed rising | Clone tasks failing — Cause D | |
num of replica missing error high but no clone tasks starting | Scheduler paused or slots exhausted | |
num of colocate replica mismatch non-zero and not decreasing | Cause E — colocate group unstable | |
| Large pending_tablets queue, few running_tablets | Cause A — throughput too low | |
running_tablets saturated, queries/writes slow | Cause B — balance too aggressive |
Step 1.3 — Identify which tablets are problematic
Phase 2 — Locate and Characterize
Step 2.1 — Identify issue type from Step 1.2
Cause A — Balance too slow
Confirm all match:
pending_tabletsqueue large (many tablets waiting)working_slotsshows low utilization (slots available but few tasks running)UnhealthyTabletNumnot decreasing over 10+ minutes- No error messages in
history_tablets
Mechanism: The tablet scheduler submits clone tasks into slots — tablet_sched_slot_num_per_path per BE path. If slots are configured conservatively (default 8) and disks are fast, the scheduler underutilizes available IO, leaving balance tasks in the pending queue far longer than necessary. Each clone copies a full tablet replica from source to destination.
→ Go to Phase 3, Cause A
Cause B — Balance too active (impacts queries/writes)
Confirm all match:
working_slotsfill rate near 100%running_tabletsat or neartablet_sched_max_scheduling_tabletslimit- Query latency elevated; load job write latency increased
iostaton affected BEs shows disk IO > 80%
Mechanism: Clone tasks perform sequential read on source and sequential write on destination. When many clones run concurrently, they compete with query scan IO and load write IO for disk bandwidth. The scheduler has no IO-awareness — it will fill all slots regardless of disk pressure.
→ Go to Phase 3, Cause B
Cause C — Decommission BE stuck
Confirm all match:
- FE leader log shows:
backend <id> lefts N replicas to decommission SHOW BACKENDSshows BE inDECOMMISSIONINGstate for > 30 minuteshistory_tabletsshowsREPLICA_RELOCATINGtasks failing
Mechanism: Decommission moves all replicas off the BE. It can block when: (1) remaining BEs cannot satisfy replication factor (e.g., 3 BEs remaining with 3-replica tables); (2) tablets exist in FE recycle bin holding replica references; (3) statistics system tables have fixed 3-replica config.
→ Go to Phase 3, Cause C
Cause D — Clone task repeated failure
Confirm all match:
history_tablets.ErrMsgcontainsunable to find dest pathor similarfailed_running_count > 3for specific tablets infe_tablet_schedulesstarrocks_be_engine_requests_total{status="failed",type="clone"}rising on specific BE
Mechanism: Clone tasks fail when the destination BE has no path with sufficient free space, the destination BE is down or unreachable, or the source tablet is in error state. Repeated failures cause the tablet to cycle in the pending queue indefinitely, keeping UnhealthyTabletNum elevated.
→ Go to Phase 3, Cause D
Cause E — Colocate group unstable
Confirm all match:
SHOW PROC "/colocation_group"shows group inUnstablestatusnum of colocate replica mismatchinsched_statis non-zero and not clearing- Group was recently affected by BE failure or BE addition
Mechanism: Colocate groups require tablets to be co-located on specific BEs as defined by the bucket sequence. When a BE fails or is added, the group is marked Unstable and the scheduler starts relocating tablets to restore the required co-location pattern. Until the group is Stable again, colocate joins degrade to regular joins.
→ Go to Phase 3, Cause E
Phase 3 — Take Action by Cause
Cause A — Balance too slow
Step A-1: Increase scheduler throughput (dynamic, no restart)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingbalance/SKILL.md
Popularity
- Repository stars
- 78
- Repository forks
- 14
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/starrocks/starrocks-debug-skills/balance)