starrocks/starrocks-debug-skills/node

Claude Code and agent skill by starrocks/starrocks-debug-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when a BE or FE node is abnormal: BE out-of-memory or crash, FE deadlock causing all queries to hang, FE Full GC pauses, or FE heap memory growth and leak. Covers mem_tracker curl analysis, large-memory-alloc log search (query_id → SQL), jstack + DeadLockChecker deadlock tracing, GC log analysis, and memory allocation flame graph interpretation.

Install

npx vskill@latest install starrocks/starrocks-debug-skills/node

SKILL.md

Node Troubleshooting (BE Crash / OOM, FE Deadlock / GC)

Investigation guide for BE-level crashes and out-of-memory events, FE deadlocks, Full GC pauses, and FE heap memory analysis.

Five root causes account for the vast majority of cases:

  • Cause A — Query-caused BE OOM (memory limit exceeded by large query)
  • Cause B — BE crash (segfault / internal fatal error)
  • Cause C — FE deadlock caused by inconsistent lock ordering
  • Cause D — FE Full GC caused by heap too small or memory leak
  • Cause E — FE OOM from specific module memory leak

Metric Taxonomy — Read This First

Before using any metrics, understand the two-layer structure:

BE-Side Metrics
Metric / SourceMeaning
curl http://<BE>:<port>/mem_trackerPer-module memory breakdown (current allocations by subsystem)
curl http://<BE>:<port>/memztcmalloc allocator internal status — heap vs OS footprint
starrocks_be_.*_mem_bytesPer-module memory gauge in Prometheus/Grafana (e.g., starrocks_be_query_mem_bytes)
be.WARNING — large memory allocSingle large allocation events, includes query_id and stack trace
dmesg — OOM KillerLinux kernel OOM Killer records listing killed process and memory pressure
FE-Side Metrics
Metric / SourceMeaning
fe.gc.log — Full GC entriesJVM Full GC frequency, stop-the-world pause duration, Old Gen occupancy
fe.WARNING — FE ShutDown! Running QueryQueries running at moment of FE OOM shutdown, each with QueryFEAllocatedMemory
fe.log — LockManager / DeadlockCheckerStructured JSON deadlock report: lock chain, waiter threads, hold durations
Memory Allocated Profile (flame graph)HTML flame graph in fe/log/proc_profile/ — per-callsite allocation breakdown
SHOW PROC '/current_queries'Live view of running queries with memUsageBytes (FE) and memUsageBytes (BE)
How to Retrieve Metrics

BE memory breakdown

bash
# Per-module memory (most useful for OOM investigation)
curl -s http://<BE_IP>:<BE_HTTP_PORT>/mem_tracker
# All BE memory gauge metrics
curl -s http://<BE_IP>:<BE_HTTP_PORT>/metrics | grep "^starrocks_be_.*_mem_bytes"
# tcmalloc allocator status
curl -s http://<BE_IP>:<BE_HTTP_PORT>/memz
# Memory-heavy queries from mem_tracker
curl -s http://<BE_IP>:<BE_HTTP_PORT>/mem_tracker | grep "query"

BE log signals

bash
# Large allocation events (include query_id)
grep "large memory alloc" be.WARNING
# OOM Killer evidence
dmesg | grep -i "oom\|killed process\|out of memory" | tail -30
# Last entries before crash
tail -200 be.WARNING
tail -200 be.ERROR

FE GC and OOM signals

bash
# Full GC frequency and pause duration
grep "Full GC\|GC pause" fe.gc.log | tail -50
# Old Gen occupancy trend
grep "Old" fe.gc.log | tail -30
# Queries running at FE OOM shutdown
grep "FE ShutDown! Running Query" fe.WARNING
# Memory audit post-incident (top N by FE memory)
python3 scripts/analyze_logs.py "2025-04-15 00:00:00" "2025-04-15 01:00:00" "QueryFEAllocatedMemory" 3 fe.audit.log
# Memory audit post-incident (top N by BE memory)
python3 scripts/analyze_logs.py "2025-04-15 00:00:00" "2025-04-15 01:00:00" "MemCostBytes" 3 fe.audit.log

FE deadlock signals

bash
# Version 3.3+
grep "LockManager" fe.log | tail -50
# Version 3.2 and earlier
grep "DeadlockChecker" fe.log | tail -50
# Capture thread dump for manual analysis
jstack -l <fe_pid> > /tmp/fe_jstack.log
# Find blocked threads
grep "parking to wait for\|BLOCKED" /tmp/fe_jstack.log | head -30

Key rules for interpretation:

  1. When dmesg shows Killed process ... (starrocks_be) — the OS killed the BE process, not a StarRocks internal error. Root cause is physical memory exhaustion, not a code bug.
  2. large memory alloc entries in be.WARNING identify the query_id responsible for the spike. One or two queries can exhaust all BE memory without hitting any per-query limit if query_mem_limit is 0 or very high.
  3. FE Full GC pauses > 10 s will cause BE heartbeat timeouts — the FE appears transiently dead. Check fe.gc.log before concluding FE is crashed.
  4. LockManager / DeadlockChecker JSON in fe.log is the fastest path to deadlock confirmation — it contains the complete lock chain with thread names and IDs.
  5. QueryFEAllocatedMemory in fe.WARNING at shutdown is the most direct signal for identifying which query caused FE OOM — match the query_id to fe.audit.log for the SQL text.

Node Issue Type Reference

SymptomIssue TypeFirst Check
BE process missing from SHOW BACKENDS; dmesg shows Killed processBE OOM (Linux OOM Killer)dmesg; be.WARNING for large memory alloc
BE process missing; no OOM in dmesg; core dump presentBE crash (segfault)Core dump stack trace; be.WARNING last 200 lines
Queries return version does not exist; DDL hangsFE deadlockfe.log for LockManager JSON; jstack
FE queries slow; SHOW FRONTENDS shows transient Alive=falseFE Full GCfe.gc.log Full GC frequency and pause duration
FE process exits; fe.WARNING shows FE ShutDown! Running QueryFE OOM (heap exhausted)fe.WARNING for QueryFEAllocatedMemory; flame graph
BE RSS grows without bound over days; no single large allocationBE memory leakmem_tracker trend; upgrade to patched version

Phase 1 — Classify Node Issue

Goal: determine issue type in under 30 seconds before deeper investigation.

Step 1.1 — BE or FE?
bash
# Check whether BE process is alive
SHOW BACKENDS; -- Alive column; LastHeartbeat timestamp
# Check whether FE is alive
SHOW FRONTENDS; -- Alive column
# If BE is down — check OOM Killer
dmesg | grep -i "oom\|killed process\|out of memory" | tail -20
ObservationNext Step
BE missing from SHOW BACKENDS; dmesg has OOM entryStep 1.2 — BE OOM path
BE missing; no OOM in dmesgStep 1.2 — BE crash path
FE queries hang or version does not exist errorsStep 1.3 — FE issue path
FE transiently Alive=false; recovers after secondsStep 1.3 — FE Full GC path
Step 1.2 — BE: OOM or Crash?
bash
# OOM: Linux kernel killed the process
dmesg | grep -i "killed process" | grep "starrocks_be"
# → If present: Cause A (BE OOM)
# Crash: core dump or signal in log
ls -lh /proc/sys/kernel/core_pattern # find core dump location
tail -50 be.WARNING
# → Look for "Segmentation fault", "SIGABRT", "Fatal signal"
# → If present: Cause B (BE crash)
Step 1.3 — FE: Deadlock or GC / OOM?
bash
# Deadlock: look for LockManager JSON in fe.log
grep "LockManager\|DeadlockChecker" fe.log | tail -5
# → If present: Cause C (FE deadlock)
# Full GC: check GC log for recent Full GC
grep "Full GC" fe.gc.log | tail -5
# → If recent Full GC with pause > 5s: Cause D (FE Full GC)
# OOM shutdown: look for shutdown message
grep "FE ShutDown! Running Query" fe.WARNING | tail -5
# → If present: Cause E (FE OOM)

Phase 2 — Locate Root Cause

Step 2.1 — BE OOM: Which Query or Workload?
bash
# Step 1: Find time window of memory spike via monitoring (Grafana or RSS trend)
# Step 2: Find large allocation events in that window
grep "large memory alloc" be.WARNING
# Output includes query_id and allocation size in bytes
# Step 3: Match query_id to SQL
grep "<query_id>" fe.audit.log
# Or check live queries if incident is ongoing:
sql
SHOW PROC '/current_queries';
-- Column: memUsageBytes — sort descending to find the largest consumer
bash
# Step 4: Check overall module breakdown
curl -s http://<BE_IP>:<BE_HTTP_PORT>/mem_tracker
# Look for which module (query, load, compaction, metadata) dominates

Pattern match:

PatternPoints toward
One or two large memory alloc entries > 1 GB from HashJoin / SortSingle large query; → Cause A
mem_tracker shows load module dominatesIngestion-side OOM; check mem_limit vs load concurrency
RSS grows slowly over days; mem_tracker shows small allocations each timeMemory tracking leak; upgrade to patched version

→ Go to Phase 3, Cause A

Step 2.2 — BE Crash: Core Dump Analysis
bash
# Confirm core dump location
cat /proc/sys/kernel/core_pattern
# Check file descriptor limit
cat /proc/<be_pid>/limits | grep "open files"
# Review log immediately before crash
tail -200 be.WARNING
tail -200 be.ERROR
# If core dump present, get stack trace
gdb starrocks_be <core_file> -batch -ex "thread apply all bt" 2>/dev/null | head -200

→ Go to Phase 3, Cause B

Step 2.3 — FE Deadlock: jstack + DeadLockChecker

Method 1 — DeadLockChecker (fastest, v2.5.15+ / 3.0.9+ / 3.1.6+ / 3.2.0+)

bash
# Version 3.3+
grep "LockManager" fe.log | tail -20
# Version 3.2 and earlier
grep "DeadlockChecker" fe.log | tail -20

The output is structured JSON:

  • lockDbName — database held
  • lockState — readLocked or writeLocked
  • slowReadLockCount — long-held read locks (threshold: slow_lock_threshold_ms, default 3000 ms)
  • lockHoldTime — write lock hold duration (ms)
  • threadInfo — stack trace of lock holder
  • lockWaiters — threads waiting for this lock

To confirm circular wait: match threadInfo thread IDs against other locks' lockWaiters.

Method 2 — jstack (when LockManager JSON is absent)

bash
# Capture thread dump
jstack -l <fe_pid> > /tmp/fe_jstack.log
# Find threads waiting for locks
grep "parking to wait for" /tmp/fe_jstack.log
# Find the lock holder for a given lock address
grep -A 5 "Locked ownable synchronizers" /tmp/fe_jstack.log | grep "<lock_address>"
# Identify long-running threads: convert PID from top -Hp to hex
top -Hp <fe_pid> -b -n 1 > top_output.txt
printf "%x\n" <thread_pid> # e.g., 19700 → 4cf4
grep "nid=0x4cf4" /tmp/fe_jstack.log

→ Go to Phase 3, Cause C

Step 2.4 — FE Heap: GC Log + Flame Graph
bash
# Check GC frequency and pause duration
grep "Full GC" fe.gc.log | tail -30
# Check Old Gen occupancy trend
grep "Old" fe.gc.log | tail -30
# Check if FE shut down due to OOM
grep "FE ShutDown! Running Query" fe.WARNING
# Locate flame graph profiles (v3.3.6+)
ls -lh fe/log/proc_profile/
# Files are .tgz archives containing HTML flame graphs
# Audit which SQL consumed most FE memory post-incident
python3 scripts/analyze_logs.py "2025-04-15 00:00:00" "2025-04-15 01:00:00" "QueryFEAllocatedMemory" 3 fe.audit.log

→ Go to Phase 3, Cause D or Cause E


Phase 3 — Take Action by Cause

Cause A — Query-Caused BE OOM

Confirm all match:

  • dmesg shows OOM Killer killed starrocks_be
  • be.WARNING has large memory alloc entries > 500 MB pointing to HashJoin, Sort, or Agg operators
  • No or very high query_mem_limit configured

Mechanism: A single large query allocates memory for HashJoin build side or Sort buffer. Without a per-query limit, it can consume all available BE memory. When RSS exceeds the system memory threshold, the Linux OOM Killer sends SIGKILL. The BE process is forcibly terminated — not a graceful shutdown. In-flight transactions cannot publish, causing downstream publish stalls and replica recovery.

Immediate: Kill the offending query

sql
-- Find the query_id from be.WARNING large memory alloc entry
KILL QUERY '<query_id>';

Set per-query memory limit

sql
-- Session level
SET query_mem_limit = 17179869184; -- 16 GB example
-- Global level
SET GLOBAL query_mem_limit = 17179869184;

Enable query spill to disk

sql
SET enable_query_spill = true;
SET spill_mem_table_size = 268435456; -- 256 MB spill trigger

Protect BE memory

bash
# Set mem_limit in be.conf to leave OS headroom (e.g., 80% of physical RAM)
mem_limit = 80%
# Restart BE to apply

Monitor recovery

bash
# Confirm BE rejoins cluster
# SHOW BACKENDS — wait for Alive=true

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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/starrocks/starrocks-debug-skills/node/badge)](https://verified-skill.com/skills/starrocks/starrocks-debug-skills/node)

Something wrong with this skill or its page? Tell us.