starrocks/starrocks-debug-skills/tablet
Claude Code and agent skill by starrocks/starrocks-debug-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when investigating tablet-level structural problems: data skew (one tablet 10× larger than peers), too many tablet versions blocking writes (too many versions error), error-state replicas, over-sharding causing high FE metadata overhead, or disk balance retry loops. Covers SHOW TABLET analysis, be_tablets SQL queries, bucket key optimization, and tablet health thresholds (VersionCount, DataSize variance, num_rowset).
Install
npx vskill@latest install starrocks/starrocks-debug-skills/tabletSKILL.md
Tablet Governance
Investigation guide for tablet health, balance, data skew, bucket optimization, and version-count / compaction-lag issues.
Five root causes account for the vast majority of cases:
- Cause A — data skew from low-cardinality bucket key
- Cause B — too many versions (compaction lag)
- Cause C — error state replicas (VERSION_ERROR, SCHEMA_ERROR)
- Cause D — too many tablets (over-sharding from fine partitions or excess buckets)
- Cause E — disk balance retry loop (metadata state inconsistency)
Metric Taxonomy — Read This First
Before using any metrics, understand the two-layer observability structure:
SQL-based observability
`SHOW TABLET FROM <table>` — per-tablet summary for a table:
| Field | Meaning | |
|---|---|---|
TabletId | Tablet identifier | |
ReplicaId | Replica identifier on a specific BE | |
BackendId | BE hosting this replica | |
SchemaHash | Schema version hash (mismatch indicates SCHEMA_ERROR) | |
Version | Latest visible version | |
VersionCount | Number of versions (rowsets) tracked by the system | |
LstFailedVersion | Last version that failed to load — non-zero indicates replica problem | |
LstSuccessVersion | Last version successfully applied | |
DataSize | Storage size of this replica in bytes | |
RowCount | Row count estimate | |
State | Replica state: NORMAL, CLONE, SCHEMA_CHANGE, ALTER |
`SHOW TABLET <tablet_id>` — single tablet detail:
| Field | Meaning | |
|---|---|---|
DbName / TableName / PartitionName | Context for this tablet | |
State | Tablet state | |
VersionCount | Version count across replicas (from detailcmd) | |
CompactionStatus URL | Link to BE compaction state JSON — shows last_base_compaction_time, cumulative_layer_point |
`information_schema.be_tablets` — per-replica metrics from BE (most detailed):
| Field | Meaning | |
|---|---|---|
be_id | BE hosting this replica | |
tablet_id | Tablet identifier | |
num_version | Total version count (all edits ever) | |
num_rowset | Active rowsets in current version — key compaction health indicator | |
num_segment | Segment files (num_rowset × segments per rowset) | |
data_size | Raw data size in bytes | |
num_row | Row count | |
state | Replica state | |
medium_type | HDD or SSD |
How to retrieve metrics
Option 1 — SQL (primary method)
Option 2 — curl BE HTTP port (compaction and rowset state)
Option 3 — BE HTTP tablet detail
Default HTTP ports: BE = 8040, FE = 8030.
Key rules for interpretation:
VersionCount > 500continuously (fromSHOW TABLET) indicates compaction cannot keep up with write rate — this is a compaction problem (see skill 12-compaction), not a tablet governance problem.DataSizevariance > 10x across tablets of the same table strongly indicates data skew from a low-cardinality or hot-value bucket key.num_rowsetinbe_tabletsequalsVersionCountfor non-PK tables; both come from_rs_metas.size(). For PK tables,num_rowset= active rowsets in latest version (usually smaller).LstFailedVersion > 0andLstFailedVersion != LstSuccessVersionon a replica means that replica has a version gap — it needs repair clone.- Total tablet count per cluster should be monitored: > 500,000 tablets creates FE metadata overhead and BE file descriptor pressure.
Tablet Health Reference
| Metric | Healthy | Warning | Act Immediately | |
|---|---|---|---|---|
VersionCount (SHOW TABLET) | < 50 | 50–500 | > 500 sustained (compaction lag) | |
DataSize variance across tablets (same table) | < 2x | 2–10x | > 10x (data skew) | |
num_rowset (be_tablets) | < 20 | 20–100 | > 100 (rowset pile-up) | |
num_row std deviation across tablets | small | std_dev > 10% of mean | single tablet holds > 50% of total rows | |
| Tablet count per BE | balanced | 20% variance | > 2x between BEs (scan skew) | |
| Total tablet count in cluster | < 100,000 | 100,000–500,000 | > 500,000 (FE heap and FD pressure) | |
LstFailedVersion on replica | 0 or equals LstSuccessVersion | Any non-zero gap | Gap growing and CloningTabletNum not rising |
Phase 1 — Assess Tablet Health
Step 1.1 — Cluster-wide quick scan
UnhealthyTabletNum = 0everywhere → proceed to performance-focused stepsUnhealthyTabletNum > 0→ note which DB IDs are affected, go to Step 1.2
Step 1.2 — BE-level tablet scan
Step 1.3 — Identify issue type
| Signal from Step 1.2 | Points toward | |
|---|---|---|
max_rowsets > 100 on multiple BEs | Cause B — compaction lag | |
size_ratio > 10 in data skew query | Cause A — bucket key skew | |
UnhealthyTabletNum > 0, ErrorStateTabletNum > 0 | Cause C — error state replicas | |
| Total tablet count > 500,000 | Cause D — over-sharding | |
history_tablets shows balance tasks cycling | Cause E — disk balance retry loop |
Phase 2 — Identify Problem Tablets
Step 2.1 — Drill into suspect table
Step 2.2 — Confirm root cause
Cause A — Data skew
Confirm all match:
DataSizevaries > 10x between tablets of the same tablenum_rowalso varies proportionally (not a compaction artifact)- Distribution key has low cardinality or a dominant hot value
→ Go to Phase 3, Cause A
Cause B — Too many versions
Confirm all match:
num_rowset > 100inbe_tabletsfor multiple tabletsVersionCount > 500fromSHOW TABLET <tablet_id>- Compaction score rising (check skill 12-compaction for compaction-specific diagnosis)
→ Go to Phase 3, Cause B
Cause C — Error state replicas
Confirm all match:
ErrorStateTabletNum > 0inSHOW PROC "/statistic"SHOW TABLET FROM <table>showsLstFailedVersion > 0and differs fromLstSuccessVersion- Replica
Stateis not NORMAL
→ Go to Phase 3, Cause C
Cause D — Too many tablets
Confirm all match:
- Total tablet count > 500,000 or tablet count per BE > 50,000
- Many small partitions (< 100MB each) or excess bucket count relative to data size
- BE log shows FD warnings or
ulimit -napproaching limit
→ Go to Phase 3, Cause D
Cause E — Disk balance retry loop
Confirm all match:
SHOW PROC "/cluster_balance/history_tablets"shows same tablet repeatedly failingErrMsgreferences metadata state or_shutdown_tablets- BE IO elevated on specific disk without progress
→ Go to Phase 3, Cause E
Phase 3 — Take Action by Cause
Cause A — Data skew (low-cardinality bucket key)
Step A-1: Confirm skew pattern
Step A-2: Identify correct bucket key
The bucket key must have high cardinality and uniform distribution. Good candidates:
- User ID, order ID, device ID (UUID-like)
- Composite keys that spread data evenly
Avoid: status, region, date, boolean columns.
Step A-3: Recreate table with better bucket key
Step A-4: Use StarRocksBuckets CLI for analysis
The standalone StarRocksBuckets utility can analyze existing distributions and generate ALTER TABLE DDL for optimal bucket count and key. Run against the affected table before deciding on the new schema.
Cause B — Too many versions (compaction lag)
Step B-1: Identify affected tablets
Step B-2: Confirm compaction type and take action
This is a compaction problem. Use skill 12-compaction for the full diagnosis.
Quick remediation:
Step B-3: Reduce import frequency if needed
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 repositoryCheckingtablet/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/tablet)