<@U0A71G31CDV> I got an issue in my cluster with ...
# questions-and-troubleshooting
q
@Rocky I got an issue in my cluster with 4 nodes FE with each node have 32 RAM and 12CPU, I already set xmx and xms in JAVA_OPTS with 24GB. But when I started it, CPU got overload very fast. GC Thread# got 99,9%. Any advise or best practice to tunning this one.
r
Short answer: the most likely problem is not GC tuning, it's that 24 GB heap on a 32 GB box is too much. What the docs say: 1. Heap sizing vs. machine RAM • FE deployed alone: if machine memory is below 32 GB →
-Xmx
at most 70%
; above 32 GB → at most 80%. You're at 32 GB with 75%. • More importantly: "it is reasonable for the memory used by the process to be less than 130% of `Xmx`" — their example is 21 GB heap → ~27 GB RSS. So
-Xmx24g
can mean ~31 GB RSS on a 32 GB host. Nothing is left for the OS, page cache, or any co-located service, which typically ends in heavy page-faulting / swap and a JVM that looks like it's doing nothing but GC. • Also check the tablet count — below 1M tablets the docs recommend 16 GB for FE, 1–2M → 32 GB. If you're under 1M tablets, 24 GB buys you nothing. Consider dropping to ~16–20 GB and see if the GC storm goes away. 2. Verify the JVM actually got what you think • The final options are echoed to
log/fe.out
at every start — check there. • If
JAVA_OPTS_FOR_JDK_11
is set, it replaces
JAVA_OPTS
entirely (they are not merged); 4.0/4.1 print a deprecation banner for it. Move everything into
JAVA_OPTS
. •
-Xms == -Xmx
is a docs recommendation (all FEs identical, since any can be Leader), not a startup requirement. 3. OS-level prerequisites (docs, environment_configurations) • Swap: disable it.
vm.swappiness=0
. •
vm.overcommit_memory=1
. • Transparent Huge Pages: set to
madvise
(THP "can interfere with the memory allocator"). • If you saw an OS OOM kill, the troubleshooting guide adds
MALLOC_ARENA_MAX=1
in
fe.conf
to curb off-heap arena growth. 4. Diagnose where the CPU actually goes before changing GC flags •
jstat -gcutil <pid> 1000 1000
— if
O
stays pinned high and
FGC
climbs, heap pressure is real; if
O
is low and it's all
YGC
, it's young-gen churn, not a leak. • GC log is already on (
-Xlog:gc*:${LOG_DIR}/fe.gc.log.$DATE:time
). Upload it to a GC analyzer and look at pause durations: a single pause >30 s, or frequent >10 s pauses, triggers a Leader switch. •
jmap -histo <pid>
(light, no forced GC) to see the top objects. 5. Startup-specific thing to rule out If the CPU spike is right at boot and the node never becomes ready, that's image load + journal replay, not steady-state GC. Look for
start load image from ...
,
start to replay journal from X to Y
,
wait globalStateMgr to be ready
. A very large
Y - X
gap means checkpoints have been failing. Also, if you persist many SQL blacklist rules there's a known issue that makes startup and checkpointing much slower — fixed in 4.1.6 / 4.0.16. On GC flags themselves: the docs only ever say "use G1 GC" (
-XX:+UseG1GC
) and "increase the heap if pauses are long". I found no official G1 fine-tuning guidance (no recommendation for
MaxGCPauseMillis
,
ParallelGCThreads
,
ConcGCThreads
,
InitiatingHeapOccupancyPercent
), so I won't invent numbers — that would be guessing. Two things would help me narrow it down: 1. How many tablets does the cluster have, and is BE running on the same 32 GB hosts? 2. Is the CPU spike at startup only, or does it keep happening after the FE is serving? And what does
jstat -gcutil
show for the
O
and
FGC
columns? References • best_practices/fe_memory_troubleshooting.md • knowledge/qa/fe_jvm_heap.md (StarRocks knowledge base) • faq/Others.md • knowledge/trouble_shooting/fe_memory_problems.md (StarRocks knowledge base) • administration/management/logs.md • knowledge/qa/fe_journal_replay_slow.md (StarRocks knowledge base)
q
@Rocky Thanks. Here is my response 1. I have 17 schemas with 1087 tablets inside cluster and I have 4 BE nodes with 64GB each node. This is my current setting JAVA_OPTS: JAVA_OPTS=“-Dlog4j2.formatMsgNoLookups=true -Xmx24576m -XX:+UseG1GC -Xlog:gc*:${LOG_DIR}/fe.gc.log.$DATE:time -XX:ErrorFile=${LOG_DIR}/hs_err_pid%p.log -Djava.security.policy=${STARROCKS_HOME}/conf/udf_security.policy --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED” 2. The CPU overload persists beyond the initial startup phase, causing all operations within the cluster to hang. This is output of jstat: jstat -gcutil 1830974 5000 60 3. S0 S1 E O M CCS YGC YGCT FGC FGCT CGC CGCT GCT 4. - 3.78 8.00 99.87 98.48 92.71 285 8.610 35 120.276 67 0.228 129.114 5. - 3.78 72.00 99.87 98.48 92.71 285 8.610 35 120.276 68 0.228 129.114 6. - 3.81 48.00 99.87 98.48 92.71 286 8.611 35 120.276 68 0.228 129.115 7. - 3.57 19.23 99.92 98.48 92.71 287 8.612 35 120.276 68 0.228 129.117 8. - 3.57 84.62 99.92 98.48 92.71 287 8.612 35 120.276 68 0.228 129.117 9. - 2.72 53.85 99.92 98.48 92.71 288 8.614 35 120.276 68 0.228 129.119 10. - 2.71 26.92 99.92 98.48 92.71 289 8.615 35 120.276 70 0.232 129.124 11. - 2.54 0.00 99.92 98.48 92.71 290 8.617 35 120.276 70 0.232 129.125 12. - 2.54 61.54 99.92 98.48 92.71 290 8.617 35 120.276 70 0.232 129.125 13. - 2.52 33.33 99.97 98.48 92.71 291 8.619 35 120.276 70 0.232 129.127 14. - 2.21 0.00 99.97 98.48 92.71 292 8.621 35 120.276 70 0.232 129.129 15. - 2.21 59.26 99.97 98.48 92.71 292 8.621 35 120.276 70 0.232 129.129 16. - 2.25 33.33 99.97 98.45 92.63 293 8.622 35 120.276 72 0.240 129.138 17. - 2.22 0.00 99.97 98.45 92.63 294 8.623 35 120.276 72 0.240 129.139 18. - 2.22 59.26 99.97 98.45 92.63 294 8.623 35 120.276 72 0.240 129.139 19. - 2.23 29.63 99.98 98.45 92.63 295 8.626 35 120.276 72 0.240 129.142 20. - 2.23 88.89 99.98 98.45 92.63 295 8.626 35 120.276 72 0.240 129.142 21. - 2.01 59.26 99.98 98.45 92.63 296 8.627 35 120.276 72 0.240 129.144 22. - 2.02 30.77 99.93 98.45 92.62 297 8.629 35 120.276 74 0.248 129.153 23. - 2.06 3.85 99.93 98.45 92.62 298 8.630 35 120.276 74 0.248 129.154 24. - 2.06 65.38 99.93 98.45 92.62 298 8.630 35 120.276 74 0.248 129.154 25. - 2.03 38.46 99.93 98.45 92.62 299 8.631 35 120.276 74 0.248 129.155 26. - 1.97 8.00 99.88 98.45 92.62 300 8.633 35 120.276 74 0.248 129.157 27. - 1.97 72.00 99.88 98.45 92.62 300 8.633 35 120.276 74 0.248 129.157 28. - 1.98 52.00 99.88 98.45 92.62 301 8.634 35 120.276 76 0.252 129.162
r
Your
jstat
output actually rules out the simple explanation, so let me read it first. What the numbers say Over ~120 s (25 samples × 5 s): •
FGC
is frozen at 35
and
FGCT
at 120.276 s. No Full GC ran during your sample window. So this isn't "full GC loop". •
CGC
climbs 67 → 76
while
CGCT
only moves 0.228 → 0.252 s. G1 is starting and finishing concurrent mark cycles every ~12 s, each costing ~2.5 ms of total time, and
O
never drops
(99.87 → 99.98%). •
YGC
285 → 301,
YGCT
8.610 → 8.634 — ~1.5 ms per young GC. Almost free. •
S1
sits at 2–3.8%,
S0
is
-
, and eden refills in ~5 s. Inference (standard G1 behaviour, not a StarRocks doc claim): a concurrent cycle that completes in ~2 ms of total time while old-gen occupancy doesn't move means G1 is aborting/restarting cycles instead of reclaiming — typically "to-space exhausted" / evacuation-failure territory. The old generation is full of live objects that cannot be freed. The CPU burn is the marking threads and repeated aborted cycles, not useful collection work.
M
(Metaspace) at 98.5% is a second thing to check. This matters because raising
-Xmx
will not fix it
, and you can't raise it anyway on a 32 GB box. The important sanity check 1087 tablets across 17 schemas is a tiny amount of metadata. The docs put 16 GB heap as sufficient below 1M tablets. A live set that fills 24 GB with ~1k tablets is anomalous — it points at a leak, a retention bug, or a specific workload (external catalogs, a pathological query), not at sizing. Grab this now, before restarting 1.
jmap -histo <pid> > histo.txt
— the docs call this "lightweight, does not force a Full GC".
head -n 30
and see which class dominates. Take a second sample 60 s later and diff. This is the single highest-value thing you can do; a restart destroys the evidence. 2.
jstat -gc <pid>
(not
gcutil
) — gives `MU`/`MC` in KB so you can see whether metaspace is genuinely near a cap or the 98.48% is just against committed size. 3. *`grep -E "to-space exhausted|Evacuation Failure|Pause Full|Concurrent" log/fe.gc.log.` — confirms or kills my read above. 4.
log/proc_profile
— memory allocation flame graphs,
.tgz
of HTML. From 3.3.6+ the FE writes them by default (
proc_profile_collect_time_s
= 120). Find the file from when memory climbed; the widest frame is the allocator. Also browsable at the FE HTTP
/proc_profile
. 5.
dmesg | grep -iE 'out of memory|oom|kill|killed process'
— with 24 GB heap you may be getting OS-killed and restarting into a fresh GC storm each time. 6. On 4.0/4.1, use
sys.fe_memory_usage
or
/api/memory_usage
for per-module sizes — a source comment says the
starrocks_fe_memory_usage
metric stays pinned to the first collection, and the periodic tracker only logs object counts on 4.x, not sizes. On your
JAVA_OPTS
string
Copy code
-Dlog4j2.formatMsgNoLookups=true -Xmx24576m -XX:+UseG1GC -Xlog:gc*:... -XX:ErrorFile=... -Djava.security.policy=... --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED
• There is no
-Xms
in it
, despite what you said — so the heap starts small and grows. Not the cause of
O
=99.9%, but it's not the config you think you have. The docs recommend
-Xms == -Xmx
on FE (any FE can become Leader). • 24 GB on 32 GB is too tight. The guide's rule: <32 GB machine →
-Xmx
≤ 70%; and it says a process using up to 130% of
Xmx
is "reasonable"
. At 24 GB heap that's ~31 GB RSS — plus metaspace at 98.5%, direct buffers, ~1 MB per thread. You have nothing left for the OS. If
dmesg
shows OOM kills, this is why. • If you ever see
hs_err_pid*.log
, that's a JVM crash, separate from OOM. What I'd want to know before recommending anything else 1. StarRocks version? There are retention bugs that match "live set too big, GC can't reclaim":
• External-catalog queries staying pinned on
query-deploy
worker threads via a ThreadLocal — a forced full GC does not reclaim it, "multi-GB on large FEs". Fixed 4.1.4 / 4.0.14, no 3.5 backport. •
com.starrocks.catalog.Replica
leak in 3.3.13–3.3.18 from DROP / SWAP / INSERT OVERWRITE. Fixed 3.3.18 / 3.4.7 / 3.5.4. 2. Do you have Hive/Iceberg/JDBC external catalogs? Each catalog gets its own remote-file cache at
remote_file_cache_memory_ratio
= 10% of max heap (so ~2.4 GB each at 24 GB), and
metastore_cache_max_num
is bounded by entry count only (default 1,000,000), never by bytes. With several catalogs that alone can consume the heap. The docs list a case where an Iceberg query spiked leader memory and CPU and hung all queries. 3. What changed right before it started? A DDL burst, an `INSERT OVERWRITE`/`SWAP`, a new external catalog, or a specific query. If
jmap -histo
shows a StarRocks class in the top few (
Replica
,
ConnectContext
,
TabletMeta
, Iceberg/Hive metadata objects), that plus the version number likely identifies a known bug — and the fix is upgrading, not GC flags. If it shows `byte[]`/`String`/`HashMap` dominating, the memory profiles in
log/proc_profile
will tell you which code path. If you can share the top 15 lines of
histo.txt
, I can narrow it further. One caution:
jmap -histo:live
and
jmap -dump
force a GC / pause the process, and the docs warn
live
"may cause FE to restart" — on a cluster that's already hanging that may be acceptable to get the answer, but know the risk first. References • best_practices/fe_memory_troubleshooting.md • faq/fe_mem_faq.md • knowledge/qa/fe_jvm_heap.md (StarRocks knowledge base) • knowledge/known_issues/query.md (StarRocks knowledge base) • knowledge/qa/slow_planning_external_catalogs.md (StarRocks knowledge base) • administration/Meta_recovery.md • data_source/datalake_faq.md References • best_practices/fe_memory_troubleshooting.md • administration/Meta_recovery.md • faq/fe_mem_faq.md • knowledge/trouble_shooting/fe_memory_problems.md (StarRocks knowledge base) • knowledge/qa/fe_jvm_heap.md (StarRocks knowledge base) • using_starrocks/caching/query_cache.md
q
@Rocky 1. Version is 4.1.7. 2. I don’t use those
@Rocky 3. I upgraded from 4.1.0 to 4.1.7 and got this issue.
r
Good — 4.1.7 rules out the leaks I listed: query-deploy ThreadLocal was fixed in 4.1.4, prepared-statement retention in 4.1.7, and the
Replica
leak was 3.3.13–3.3.18 only. And with no external catalogs, the per-catalog remote-file cache theory is out too. So no known FE heap leak in the docs matches your build. Reread your
jstat
— it says GC is not what's hanging your cluster
•
FGC
frozen at 35 for the whole 2 minutes,
YGCT
grew 0.024 s total (≈1.5 ms per young GC). • Total GC time across 120 s: ~0.03 s. GC is using essentially zero CPU. So "GC threads at 99.9%" and "no GC work being done" are contradictory. That's the crux: either the threads labelled
GC Thread#N
are not actually doing GC, or the process is stalled in a way that makes
jstat
numbers meaningless.
Either way, a GC tuning change cannot fix a hang that GC is not causing. The one real signal is
O
pinned at 99.9% and never dropping
while G1 completes 9 concurrent cycles in 2 minutes without reclaiming anything. My read (inference, not a doc claim): G1 is starting mark cycles that find nothing collectable, because the old gen is full of live objects. That's retention, not sizing — and 1087 tablets / 17 schemas is far too little metadata to justify ~24 GB live. Also worth noting:
M
= 98.48% means metaspace is at 98.5% of committed, which forces repeated class-unloading attempts (each one runs a full GC) — consistent with your 35 FGCs at ~3.4 s each. That's a separate problem from the heap. Do these, in this order — on the affected FE, before restarting 1. You're on 4.1.7, so
sys.fe_memory_usage
works.
It returns 0 rows on versions before 4.1.7. Take two snapshots a few minutes apart and diff
current_consumption
per `module_name`:
Copy code
sql
SELECT module_name, class_name, current_consumption, peak_consumption FROM sys.fe_memory_usage ORDER BY peak_consumption DESC;
If it still returns nothing, fall back to
curl http://127.0.0.1:<http_port>/api/memory_usage
on the FE host (it only answers from localhost). Modules are Load / Compaction / Export / Delete / Transaction / Backup / Task / TabletInvertedIndex / LocalMetastore / Report / MV / Query / Profile / Agent / Statistics / Coordinator / Dict — you can also drill in per module with
SELECT inspect_memory('Query')
or
inspect_memory_detail('Task','TaskManager')
. 2.
jmap -histo <pid> | head -30
— no forced GC, negligible impact. Two samples 60 s apart. This is the single most informative artifact and a restart destroys it. 3.
top -Hp <pid>
then map the busy native IDs to
jstack -l <pid>
.
This settles whether the 99.9% is really GC workers. If the hot threads turn out to be
starrocks-mysql-nio-pool-*
or optimizer threads, the problem is a runaway query / lock contention and GC is a red herring. If they are genuinely
GC Thread#N
,
G1 Conc#
or
G1 Young RemSet
, then my retention read is right. 4. Memory profile. On 4.1 the interval config
proc_profile_collect_interval_s
does not exist — use
proc_profile_collect_time_s
(default 120) plus
proc_profile_mem_enable
, both mutable via
ADMIN SET FRONTEND CONFIG
. Files land in
log/proc_profile
, browsable at FE HTTP
/proc_profile
. Find the capture from when the heap climbed. *5. `grep -E "to-space exhausted|Evacuation Failure|Pause Full|Metaspace" log/fe.gc.log.` — confirms or kills my read, and tells you when those 35 Full GCs happened (were they all in one window? that's your leader-switch event). 6.
dmesg | grep -iE 'oom|killed process'
and
free -g
/ swap usage.
24 GB heap on 32 GB, plus metaspace near its cap, plus direct buffers — the guide says up to 130% of
Xmx
is normal, i.e. ~31 GB here. If you're paging, everything looks frozen and
jstat
freezes too. On the heap config
Your string has no
-Xms
, so the heap grows from a small initial value. Add
-Xms24576m
. But I'd rather you lower it: the guide's rule is
-Xmx
≤ 70% of RAM below 32 GB, and 16 GB is stated as sufficient below 1M tablets. Try
-Xms16g -Xmx16g
— if the live set is genuinely ~24 GB at 1087 tablets, 16 GB won't OOM faster, it will make the retention obvious instead of hiding it behind a huge heap. Two questions that would pin this down 1. Is it only the Leader, or all 4 FEs? If all 4, it's not leader-only metadata load — it's something every FE does (stats, report handling, or a query). If only the Leader, look at
ReportHandler
/ tablet-report / checkpoint. 2. What happened right before it started? A specific query, an
ANALYZE
, an MV refresh, a big `INSERT OVERWRITE`/`DROP`, or a burst of connections? And are clients using prepared statements on long-lived connections? That leak is fixed in 4.1.7, but if you upgraded to 4.1.7 without restarting the FEs, you're still running the old code. If
histo
shows a StarRocks class dominating, paste the top 15 lines and I can tell you whether it's a known bug or a workload shape. If nothing stands out in
histo
but
sys.fe_memory_usage
shows one module climbing steadily, that module is the answer. References • best_practices/fe_memory_troubleshooting.md • knowledge/known_issues/fe_metadata.md (StarRocks knowledge base) • faq/fe_mem_faq.md • knowledge/trouble_shooting/fe_memory_problems.md (StarRocks knowledge base) • knowledge/qa/fe_jvm_heap.md (StarRocks knowledge base) • knowledge/known_issues/query.md (StarRocks knowledge base)
That changes the picture. Short version: I could not find any documented FE heap regression introduced in 4.1.7, so I can't blame the upgrade directly. What I can do is tell you which 4.1.7-specific fixes change the diagnosis, and give you the tools that only exist on 4.1.7. What 4.1.7 actually fixed (relevant to your symptom) Several FE heap leaks were fixed in 4.1.7 and 4.0.17 — meaning you were carrying these on 4.1.0 and should now be free of them: • Prepared statements not released on COM_STMT_CLOSE — the statement ID was decoded with the wrong byte order, so statements and bound parameters were retained on long-lived connections until the FE ran out of heap. Fixed 4.1.7 / 4.0.17, no 3.5 backport. If your clients use prepared statements, this alone would fill a heap. • Finished transactions never cleaned up — the label cleaner hit an NPE once per hour, which aborted the whole expired-transaction removal round, so the map grew to millions of entries at ~0.7 GB/h. Fixed 4.1.7 / 4.0.17. •
sys.fe_memory_usage
returned 0 rows
before 4.1.7 — now it works and computes on demand (cached 10 s). None of the ~60 items in the 4.1.7 release notes read as "hurts FE memory". So my honest read is: this is a live-set/leak problem that 4.1.7 did not fix, not something 4.1.7 introduced — but I can't rule out an undocumented regression. Two hypotheses that fit "persists, all operations hang" (a) Checkpoint retry loop. The docs say FE checkpointing is memory-expensive because it loads the image, replays log, and saves a separate image — that's roughly a second copy of the metadata alongside the live one (this is why 3.4.0 offloaded checkpointing to followers, since "before, the leader's memory was 3x the follower's"). With old gen at 99.9% live and no full GC, a checkpoint may never be able to complete, retry forever, and burn CPU while blocking the operations that wait on it. Check
fe.log
for checkpoint start/finish/error lines and the size of
meta/image
. (b) Stuck journal replay. Writes pile up and everything waits. 4.1.6+ added
metadata_replay_stuck_warn_threshold_second
(default 30, 0 disables) and logs
journal N (opCode X) has been replaying for Nms, metadata of this node is frozen at M. replayer stack: ...
at most every 30 s. Grep for
has been replaying for
. Do these three first — you have the tools on 4.1.7 1. *`SELECT * FROM sys.fe_memory_usage;`* (needs OPERATE). Columns
module_name, class_name, current_consumption, peak_consumption
. Take two snapshots 5 minutes apart and diff. This is the tool that was broken before your upgrade — use it. On the FE host,
curl 127.0.0.1:8030/api/memory_usage
gives the same plus JVM heap/non-heap/direct numbers (it only answers from localhost). 2.
jmap -histo <pid> > histo.txt; head -n 30 histo.txt
— light, no forced GC. With 1087 tablets, nothing legitimate should be large. If
com.starrocks.catalog.Replica
,
InsertLoadJob
, prepared-statement or connector metadata objects are in the top 15, that identifies the leak class. 3.
jstack -l <pid> > jstack.txt
while it's hanging — look for
parking to wait for
on the same lock object ID, which is exactly the documented FE deadlock triage method. Note that 4.1.0+ has queryable locks on TabletInvertedIndex/RoutineLoadJob that log slow acquisitions with holders and stacks; check
fe.warn.log
for slow-lock warnings. On the config and the upgrade • Your heap is the wrong shape but not the root cause. No
-Xms
in your string means the heap grows from a small initial size to 24 GB; the docs recommend
-Xms == -Xmx
on FE. And 24 GB on a 32 GB box breaks the "≤70% under 32 GB" rule; the guide says up to 130% of
Xmx
for the process is "reasonable", i.e. ~31 GB RSS here — you're one allocation spike from an OS OOM kill. Verify with
dmesg | grep -iE 'killed process|oom'
.
•
-Xmx
will not help.
O
=99.9% with
FGC
frozen at 35 means G1 has nothing to reclaim; a bigger heap just delays it, and you can't grow it on 32 GB anyway. If you want the fastest path back to working A patch downgrade is supported (
v3.5.11 → v3.5.6
is the docs' example), so 4.1.7 → 4.1.0 is a legitimate patch downgrade and a cheap A/B test: if 4.1.0 was genuinely stable, going back confirms the regression. Order matters: downgrade Follower FEs first, then the Leader, and run
ALTER SYSTEM CREATE IMAGE
beforehand and confirm the leader logs
push image.* ... successfully
. If you hit
UNKNOWN Operation Type xxx
, the recovery procedure is to stop all FEs, back up
meta_dir
, set
metadata_ignore_unknown_operation_type = true
in all
fe.conf
, start, verify, then
ALTER SYSTEM CREATE IMAGE
. Before you downgrade, grab
histo.txt
and the
sys.fe_memory_usage
snapshots.
A restart or downgrade destroys the evidence, and if it is an unfixed leak you'll be back here in a few days with nothing to show a maintainer. What I don't know and won't guess: whether there's a 4.1.7-specific regression, and the correct G1 flag tuning — the docs only ever say "use G1" and "raise the heap", with no `MaxGCPauseMillis`/`ParallelGCThreads` guidance. If the leak classes point at a specific bug, the StarRocks GitHub issues page is the place to confirm it, and the community Slack/forum for maintainer input. References • release_notes/release-4.1.md • knowledge/known_issues/fe_metadata.md (StarRocks knowledge base) • knowledge/qa/fe_jvm_heap.md (StarRocks knowledge base) • best_practices/fe_memory_troubleshooting.md • knowledge/trouble_shooting/fe_memory_problems.md (StarRocks knowledge base) • knowledge/trouble_shooting/fe_deadlock_problems.md (StarRocks knowledge base) • knowledge/qa/fe_journal_replay_slow.md (StarRocks knowledge base) • deployment/manage_deployment/downgrade.md • administration/Meta_recovery.md References • knowledge/known_issues/fe_metadata.md (StarRocks knowledge base) • release_notes/release-4.1.md • best_practices/fe_memory_troubleshooting.md • faq/fe_mem_faq.md • knowledge/qa/fe_jvm_heap.md (StarRocks knowledge base) • knowledge/trouble_shooting/fe_memory_problems.md (StarRocks knowledge base)
q
@Rocky SELECT module_name, class_name, current_consumption, peak_consumption FROM sys.fe_memory_usage ORDER BY peak_consumption DESC; module_name |class_name |current_consumption|peak_consumption| -------------------+----------------------+-------------------+----------------+ RecycleBin |CatalogRecycleBin | 3273128641| 3273128641| TabletInvertedIndex|TabletInvertedIndex | 691234323| 691234323| Transaction |GlobalTransactionMgr | 394270607| 394270607| LocalMetastore |LocalMetastore | 114394905| 114394905| Load |LoadMgr | 23537452| 23537452| Load |RoutineLoadMgr | 6250201| 6250201| Compaction |CompactionMgr | 2936656| 2936656| Statistics |CachedStatisticStorage| 847978| 847978| Delete |DeleteMgr | 473104| 473104| Coordinator |QeProcessorImpl | 350372| 350372| Task |TaskManager | 29157| 29157| Profile |ProfileManager | 18479| 18479| Backup |BackupHandler | 536| 536| Statistics |ColumnMinMaxMgr | 481| 481| Report |ReportHandler | 480| 480| Load |InsertOverwriteJobMgr | 112| 112| Load |StreamLoadMgr | 104| 104| Export |ExportMgr | 80| 80| Statistics |CacheRelaxDictManager | 48| 48| Dict |CacheDictManager | 48| 48| Task |TaskRunManager | 0| 0| Query |QueryTracker | 0| 0| MV |MVTimelinessMgr | 0| 0| Agent |AgentTaskTracker | 0| 0|
r
Two things in this output matter, and one of them is a trap. Read the caveat first: these numbers can't explain 24 GB Summing your column gives ≈ 4.5 GB tracked out of a ~24 GB heap at 99.9% occupancy. That's not a discrepancy to chase — the troubleshooting guide is explicit that
MemoryUsageTracker
computes shadow memory: "only the size of the object itself, not the size of the objects it references... same as jmap... this is not helpful for analyzing the memory occupied by each module, only for analyzing memory leaks — by comparing the module's historical data." So treat the table as a trend detector, not an attribution tool. Which brings me to the trap:
current_consumption
equals
peak_consumption
exactly for all 25 rows.
That means you effectively have one sample — peak has never had a chance to diverge. Take a second snapshot in 5–10 minutes and diff; only the delta is meaningful. If RecycleBin's number doesn't move and something else climbs, that's your leak. One real anomaly: RecycleBin at 3.27 GB You have 1087 live tablets. A recycle bin holding 3.27 GB of dropped-object metadata next to a cluster that small means a large volume of DROP / INSERT OVERWRITE / MV-refresh history is parked there. This matches the guide's Case 1: "sequential operations creating dozens of tables per second and synchronously deleting them, resulting in hundreds of thousands of tables... heap memory and machine CPU continue to rise, and query response slows down." Their stated fix: use
DROP TABLE ... FORCE
so metadata isn't retained, and reduce DDL concurrency.
Confirm it before acting — on 4.0/4.1, as root:
Copy code
sql
SELECT TYPE, COUNT(*) FROM information_schema.recyclebin_catalogs GROUP BY TYPE;
If that returns six figures, this is a retention problem, not a GC problem. Important: you already have the recycle-bin leak fixes. Two known issues here were fixed in 4.1.0 — FE memory growing per table dropped on shared-nothing (PR 68275) and partition info retained after successful async delete (PR 61582). You're on 4.1.7, so you have both. That points at legitimate retention of a very large drop volume rather than an unfixed leak — which is good news, because it means the levers below will actually work. The reason it accumulates rather than draining:
catalog_trash_expire_second
defaults to 86400 s, so dropped objects sit a full day. Drain is then rate-limited —
catalog_recycle_bin_erase_max_operations_per_cycle
= 500 objects per cycle (it holds a lock, so batches are deliberately small),
catalog_recycle_bin_erase_min_latency_ms
= 600000 (10 min minimum delay), and failures retry every 60 s. A big burst therefore takes a long time to clear, and every erase cycle takes locks on a cluster where everything is already waiting on locks. Levers, in order: 1.
ADMIN SET FRONTEND CONFIG ("catalog_trash_expire_second" = "3600");
— mutable at runtime. Only if you accept losing RECOVER beyond 1 hour. Put it in
fe.conf
too so it survives restart. 2. Switch your DDL/job to
DROP ... FORCE
— skips the bin entirely. 3. Watch FE logs for erase errors (
RPC timeout
, deletion failures) — a stuck erase keeps objects resident indefinitely. 4. Note INSERT OVERWRITE / MV-refresh partitions are not the culprit for the 24h figure — those use
partition_recycle_retention_period_secs
= 1800. What this still doesn't answer RecycleBin at 3.27 GB cannot fill a 24 GB heap. ~20 GB is untracked. Also note
Query = 0
and
Coordinator = 350 KB
while the whole cluster is hanging — if queries were stacked up waiting, I'd expect something there. And there's no
Connector
row at all, so external-catalog metadata (Hive/Iceberg/JDBC) is invisible in this table.
So
jmap -histo
is still the missing piece — it measures the same shallow sizes but over every class, including the untracked ones. Top 15 lines will tell us whether it's `Replica`/`TabletMeta` (metadata side), `byte[]`/`HashMap`/connector classes (catalog-side), or prepared-statement/`ConnectContext` objects. Your earlier
jstat
also showed Metaspace at 98.48%, which is its own signal (classloader/metaspace growth, typically external catalog plugins) and is not in this table. Two questions: 1. Shared-data or shared-nothing? If shared-data with automated cluster snapshots, the bin can fail to drain — that specific bug was fixed in 4.1.2 so you should be clear, but I'd still check that snapshot jobs reach FINISHED. 2. What happened just before this started? A DDL burst, a
CREATE OR REPLACE
/
INSERT OVERWRITE
schedule, or a new external catalog being created at regular intervals. And to be straight with you: I can see RecycleBin is abnormal, but I cannot honestly claim it's the root cause of a 99.9%-live heap — the arithmetic doesn't support that. It's a real problem worth fixing, likely a contributing one, but
jmap -histo
plus a second
sys.fe_memory_usage
snapshot are what will actually identify the ~20 GB. References • administration/configuration/FE_parameters/stats_storage.md • knowledge/known_issues/fe_metadata.md (StarRocks knowledge base) • faq/operation_maintenance_faq.md • administration/configuration/BE_parameters/stats_storage.md • sql-reference/information_schema/recyclebin_catalogs.md • knowledge/qa/shared_data_vacuum_and_storage_cleanup.md (StarRocks knowledge base)
q
@Rocky TYPE |count(*)| ---------+--------+ Partition| 116462| Table | 72073|
r
The number that stands out 72,073 tables in the recycle bin against 17 live schemas and 1087 live tablets. That isn't a retention setting problem — it's a workload signature. It matches the troubleshooting guide's Case 1 almost exactly: "sequential operations creating dozens of tables per second and synchronous operations deleting them, resulting in the creation of hundreds of thousands of tables… Heap memory and machine CPU continue to rise, and query response slows down." Their stated fix:
DROP TABLE ... FORCE
so metadata isn't retained, and reduce DDL concurrency.
So: something in your environment is creating and dropping tables at volume.
CREATE TABLE AS SELECT
, temp/staging tables, a scheduler creating per-run tables, or MV refresh churn. Why this may be more than 3.27 GB I flagged last time that 3.27 GB can't fill a 24 GB heap. That's still true for the tracked number — but the tracker measures shallowness only ("only the size of the object itself, not the size of the objects it references"). Each of those 72k table entries references schemas, columns, partition objects and tablet metadata in the real heap; 116k partition entries likewise. So the gap between 3.27 GB shallow and the actual retained graph could be large. I'm inferring that, not asserting it —
jmap -histo
settles it.
Your
TabletInvertedIndex
at 691 MB is corroborating. With only 1087 live tablets that should be small. The deadlock-triage stacks show the code path plainly:
LocalMetastore.onErasePartition
→
TabletInvertedIndex.deleteTablet
. Tablet entries are removed from the inverted index at erase time, not at drop time. If 188k objects are queued in the bin, a large amount of tablet metadata can still be indexed. (Inference from that stack, not a documented statement.) Confirm it or kill it — one query
DROP_TIME
is a column on `information_schema.recyclebin_catalogs`:
Copy code
sql
SELECT TYPE, COUNT(*), MIN(DROP_TIME), MAX(DROP_TIME)
FROM information_schema.recyclebin_catalogs GROUP BY TYPE;
• Oldest
DROP_TIME
older than 86400 s (1 day)
→ the bin is not draining. That's a real fault, not volume, and worth a GitHub issue. Note you already have the known drain fixes: the snapshot-blocking bug (fixed 4.1.2) and same-name partitions stuck permanently (fixed 4.1.0). You're on 4.1.7, so neither should apply — which makes a stuck bin an unknown cause I can't attribute. • All within the last day → retention is working as designed; you simply have enormous legitimate churn, and the levers below apply. Also:
Copy code
bash
grep "Finished drop table" fe.log | wc -l     # is the churn still running?
grep -iE "RPC timeout|failed to (erase|delete)" fe.log
The shared-data FAQ names FE log deletion errors (e.g. RPC timeout) as why cleanup stalls. And the troubleshooting guide's own recovery for Case 1 is to stop the create/drop job — if the churn is still active, you're bailing water while the tap runs. Levers (all mutable, all verified defaults) 1.
catalog_recycle_bin_erase_max_operations_per_cycle
— default 500. 188k objects ÷ 500 ≈ 376 erase cycles just to drain the current backlog. Raising it speeds the drain. Tradeoff: the docs say "the erase operation holds a lock, so one batch should not be too large" — on a cluster where everything is already hanging on locks, a bigger batch means longer lock holds. Raise it moderately, not to 100000. 2.
catalog_trash_expire_second
— default 86400. Lower it (e.g. 3600) plus the same line in
fe.conf
for persistence. Cost:
RECOVER
stops working beyond the new window. 3. Switch DDL to
FORCE
—
DROP TABLE t FORCE
,
ALTER TABLE t DROP PARTITION p FORCE
. Skips the bin entirely. In shared-data, force-dropped objects go into the bin marked non-recoverable and are erased on the next cycles without waiting for retention — so this is effective there too.
4.
catalog_recycle_bin_erase_fail_retry_interval_ms
— default 60000, if you see repeated erase failures. 5.
catalog_recycle_bin_erase_min_latency_ms
— default 600000 (10 min). It exists and is mutable, but its stated purpose is "to avoid the erase log being written ahead of the drop log." I don't know the consequences of lowering it safely, so I won't recommend it. You're on 4.1.7, so you also have the bin-count gauges (
recycle_bin_database_num
,
recycle_bin_table_num
,
recycle_bin_partition_num
, added 4.1.2) — worth alerting on. But don't skip
jmap -histo
.
RecycleBin at 3.27 GB + TabletInvertedIndex at 691 MB is ~4 GB of 24 GB. If
jmap
shows the bin-related object graph deeper than the tracker suggests, that closes the gap. If it shows `byte[]`/connector/prepared-statement classes dominating instead, the bin is a separate problem and the real leak is elsewhere. What I could not confirm • That the recycle bin accounts for ~20 GB of untracked heap. Plausible, unproven —
jmap -histo
decides. • That a 4.1.7 recycle-bin drain bug exists. I found no such report, and you have the 4.1.0/4.1.2 fixes. • Why
MAX(DROP_TIME)
behaviour is what it is — the DROP_TIME query is the point. • Whether your cluster is shared-data. Please tell me. The bin behaves differently there (snapshot boundary, force-drop semantics), and several relevant fixes are shared-data-specific. If
DROP_TIME
shows a genuinely stuck bin on 4.1.7 with the known fixes in place, that's a bug report for the StarRocks GitHub issues page, and the community Slack for maintainer eyes — not something I can resolve from docs. References • best_practices/fe_memory_troubleshooting.md • sql-reference/information_schema/recyclebin_catalogs.md • administration/configuration/FE_parameters/stats_storage.md • sql-reference/sql-statements/table_bucket_part_index/DROP_TABLE.md • sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md • faq/shared_data_faq.md • knowledge/known_issues/fe_metadata.md (StarRocks knowledge base) • knowledge/trouble_shooting/fe_deadlock_problems.md (StarRocks knowledge base) • knowledge/qa/shared_data_vacuum_and_storage_cleanup.md (StarRocks knowledge base) References • administration/configuration/FE_parameters/stats_storage.md • faq/operation_maintenance_faq.md • knowledge/known_issues/fe_metadata.md (StarRocks knowledge base) • best_practices/fe_memory_troubleshooting.md • sql-reference/information_schema/recyclebin_catalogs.md • administration/Data_recovery.md
q
@Rocky TYPE |count(*)|min(DROP_TIME) |max(DROP_TIME) | ---------+--------+-----------------------+-----------------------+ Table | 72073|2026-11-08 070213.000|2026-11-18 160915.000| Partition| 116462|2026-09-06 092210.000|2026-11-18 160915.000|
r
Your bin is not draining — that's now proven The retention default is 86400 s (1 day): "The longest duration the metadata can be retained after a database, table, or partition is dropped." Your oldest entries are way past that: TYPE | oldest DROP_TIME | exceeds 1 day by Partition | 2026-09-06 09:22 | ~73 days Table | 2026-11-08 07:02 | ~10 days A working erase would have removed those long ago. So this isn't "retention set too high" and isn't simply churn volume — erase is failing or being skipped, and your 500-per-cycle budget (376 cycles for the backlog) is irrelevant while every cycle accomplishes nothing. The stall ages differ by type (partitions 73d, tables 10d), which means the partition erase path has been broken longer than the table path — consistent with two different blockers rather than one global "erase thread is dead". Two documented candidates fit exactly: 1. Shared directory skip. "When a partition's path does not end with its physical partition id, partition erase skips it and logs
Skipped remove possible directory shared by multiple partitions
."
A skipped entry visibly stays in
recyclebin_catalogs
forever. Grep
fe.log
for that exact string.
2. Delete-tablet RPC to BE timing out. The 4.1.7 known issue "BE memory climbs to tens of GB during bulk tablet deletion" documents
Failed to get delete tablet response... 600000ms
— FE giving up waiting on a bulk delete. A timed-out erase is retried every
catalog_recycle_bin_erase_fail_retry_interval_ms
(60000) — i.e. a huge, failing delete retried forever, holding the erase lock. Grep for
Failed to get delete tablet response
and
Fail to read tablet_id=
.
Note the closest known bug — "Recycled partitions with the same name stay stuck in the recycle bin permanently" — is fixed in 4.1.0, and you're on 4.1.7. So either you're hitting a different cause (the two above), or a residual gap in that fix. I can't tell which from docs. The question I still need answered Is this shared-data or shared-nothing? I asked before and still don't know, and it decides everything: the shared-directory skip, shard-group deletion, snapshot-boundary erase gating and
meta_sync_force_delete_shard_meta
are all shared-data-only. Candidate 2 (delete-tablet resp) is lake/CN-specific.
Copy code
sql
SHOW STORAGE VOLUMES;               -- or check your CREATE TABLE properties
ADMIN SHOW AUTOMATED CLUSTER SNAPSHOT;
SELECT * FROM information_schema.cluster_snapshot_jobs ORDER BY created_time DESC LIMIT 5;
If snapshot is enabled and no job has reached
FINISHED
, erase is gated on it. That bug is fixed in 4.1.2, so you should be clear — but verify, because it's free to check. Run these three now 1. Snapshot the gauge twice, 30 min apart —
curl -s localhost:8030/metrics | grep recycle_bin
. You're on 4.1.7 so these exist (added 4.1.2). Flat = erase is doing nothing at all. Slowly falling = it's working but stalled. This one command tells you which world you're in. 2. Grep for the error strings above in the leader's
fe.log
, plus generic
RPC timeout
(the shared-data FAQ names that as the reason cleanup stalls). 3. Find the source of the churn — your newest drop is today at 16:09, so something is still deleting.
grep -c "DROP TABLE\|DROP PARTITION" fe.audit.log
, then identify the user/client. Draining while the tap runs won't finish. If you need relief before understanding it
meta_sync_force_delete_shard_meta
is documented for precisely your situation: *"It is recommended to set this item to
true
only when there is an excessive number of shards to be cleaned, which leads to extreme memory pressure on the FE JVM. Note that the data files belonging to the shards or tablets cannot be automatically cleaned after this feature is enabled."*
That is an explicit trade of object-storage garbage for FE heap. Given you're at 99.9% old gen and hanging, it may be the right trade — but it is a one-way door on those files, so I'd only pull it after step 1 confirms the erase isn't progressing, and I'd want to know it's shared-data first. Raise
catalog_recycle_bin_erase_max_operations_per_cycle
(500 → e.g. 2000) as the safer first move, remembering the doc's warning that "the erase operation holds a lock, so one batch should not be too large" — on a cluster already hanging on locks, that cuts both ways. Honest limits I've now shown the bin is stuck. I have not shown it accounts for your ~20 GB of untracked heap — shallow 3.27 GB can't, and the tracker explicitly doesn't measure referenced objects, so the real retained graph could be several times larger. That remains inference.
jmap -histo
is still the arbiter, and a restart or downgrade destroys both it and the reset-bin evidence. Where docs stop: there is no documented way to manually purge the recycle bin, and no documented per-object erase error reporting. If step 1 shows flat gauges with no log errors on 4.1.7, that's a bug report for the StarRocks GitHub issues page with the gauge trend, the log greps, and
histo.txt
attached — and the community Slack for maintainer input. References • administration/configuration/FE_parameters/stats_storage.md • sql-reference/information_schema/recyclebin_catalogs.md • administration/configuration/FE_parameters/shared_lake_other.md • knowledge/qa/shared_data_vacuum_and_storage_cleanup.md (StarRocks knowledge base) • knowledge/known_issues/shared_data.md (StarRocks knowledge base) • knowledge/known_issues/fe_metadata.md (StarRocks knowledge base) • faq/shared_data_faq.md • administration/management/monitoring/metric_details/q-r.md • administration/management/cluster_snapshot.md References • administration/configuration/FE_parameters/stats_storage.md • faq/shared_data_faq.md • knowledge/known_issues/fe_metadata.md (StarRocks knowledge base) • knowledge/known_issues/shared_data.md (StarRocks knowledge base) • faq/operation_maintenance_faq.md • administration/configuration/BE_parameters/stats_storage.md
q
@Rocky It is shared-data This is a output mysql> SHOW STORAGE VOLUMES; -- or check your CREATE TABLE properties +----------------+ | Storage Volume | +----------------+ | gold_volume | | bronze_volume | | def_volume | | raw_volume | | silver_volume | +----------------+ 5 rows in set (0.00 sec) mysql> ADMIN SHOW AUTOMATED CLUSTER SNAPSHOT; +---------+----------+---------------+------------------+------------------+ | Enabled | Interval | StorageVolume | LastSnapshotTime | NextSnapshotTime | +---------+----------+---------------+------------------+------------------+ | false | NULL | NULL | NULL | NULL | +---------+----------+---------------+------------------+------------------+ 1 row in set (0.00 sec) mysql> SELECT * FROM information_schema.cluster_snapshot_jobs ORDER BY created_time DESC LIMIT 5; Empty set (0.02 sec)
r
One candidate just died Automated cluster snapshot is off (
Enabled=false
, no jobs, empty job table). So the snapshot-boundary gate is not your blocker, and the known issue "the bin never drained if no snapshot job had ever finished" (fixed 4.1.2 / 4.0.12 / 3.5.19) is ruled out for you. Scratch that line of enquiry. A correction I owe you I said last time the stuck bin was "proven." Shared-data confirms the mechanism, but there's one config that would make Sept 6 a legitimate drop rather than a stuck one. Check it before we go further:
Copy code
sql
ADMIN SHOW FRONTEND CONFIG LIKE "catalog_trash_expire_second";
If someone raised that above ~73 days, nothing is broken and this is pure retention. I'll assume default 86400 below, but verify. Why shared-data changes the diagnosis In shared-data, erase isn't just removing FE metadata — it has to delete shard groups/tablets via StarMgr and then the object-storage files. That's where it breaks, and the failure mode is exactly your symptom chain. The source comment on
meta_sync_force_delete_shard_meta
says it outright:
*"Whether allows delete shard meta if fails to delete actual data. In extreme cases, actual data deletion might fail or timeout, and if shard meta is not deleted, the FE memory will grow, eventually cause fe frequently Full GC."*
That is a literal description of 99.9% GC threads and a 24 GB heap at 99.87%. The docs gate that flag on "an excessive number of shards to be cleaned, which leads to extreme memory pressure on the FE JVM." 188,535 bin objects qualifies. Grep the leader's fe.log — one of these will hit String | Meaning
Failed to get delete tablet response
| FE gave up on bulk tablet deletion (documented, 600000ms timeout). Erase retries every 60s forever, holding the lock
Fail to read tablet_id=
| Same path
Skipped remove possible directory shared by multiple partitions
| Partition path doesn't end with its physical partition id → erase silently skips it, entry stays forever
RPC timeout
| Named by the shared-data FAQ as why cleanup stalls
shard group ... not exist
| Shard group already gone but FE bin still scans the partition The 73-day vs 10-day split (Partition 2026-09-06, Table 2026-11-08) still points at two different blockers — partition erase broken ~7 weeks longer than table erase. That fits the shared-directory skip for partitions specifically. Confirm the trend, then act
Copy code
bash
curl -s localhost:8030/metrics | grep -E "recycle_bin_(table|partition|database)_num"
Twice, 30 minutes apart. Flat = erase is accomplishing nothing. Falling = it works but is far behind. You're on 4.1.7 so these gauges exist. Then, given FE memory pressure is the emergency: 1.
ADMIN SET FRONTEND CONFIG ("meta_sync_force_delete_shard_meta" = "true");
— the documented escape hatch. Cost, verbatim: "the data files belonging to the shards or tablets cannot be automatically cleaned after this feature is enabled." You buy FE heap with orphaned object storage, reclaimed later by
meta_tool.sh --operation=lake_datafile_gc
(run with
--do_delete=false
first; it loads tablet meta into memory, so go partition-by-partition, not cluster-wide). 2.
catalog_recycle_bin_erase_max_operations_per_cycle
500 → 2000. 188k ÷ 500 = 376 cycles just to drain the backlog. Mind the doc's warning: "the erase operation holds a lock, so one batch should not be too large" — on a cluster already hanging on locks this cuts both ways. 3. Kill the source. Your newest drop is today 16:09 — something is still deleting at volume.
grep -c "DROP TABLE\|DROP PARTITION" fe.audit.log
, find the user/client, stop it.
DROP ... FORCE
on shared-data puts objects in the bin as non-recoverable and they're erased on the next cycles without waiting for retention — so switch the job to FORCE rather than tuning retention down.
4. Lowering
catalog_trash_expire_second
does less than you'd expect here, because force-dropped objects skip the wait anyway. Use it only if the DDL still can't be changed. What's ruled out The close known issues are all fixed on your build: shards left in cluster metadata after successful tablet deletion (4.1.0), recycled partitions with the same name stuck forever (4.1.0), meta sync abort on missing shard group after TRUNCATE (4.1.6). You're on 4.1.7, so all three are in. The timing doesn't quite fit yet Your partition backlog starts Sept 6, ~73 days ago — before you upgraded from 4.1.0 to 4.1.7. So the upgrade probably amplified a pre-existing stuck bin rather than causing it. Two things I'd like to know: 1. When did you upgrade, and did the bin counts start climbing before or after? 2. Are the five storage volumes (
gold/bronze/def/raw/silver
) all in active use, and do tables get moved between them? Path/volume handling is directly relevant to the shared-directory skip. Honest limits I still cannot attribute your ~20 GB of untracked heap to the bin by arithmetic — 3.27 GB shallow can't get there, and the tracker explicitly doesn't count referenced objects. The
meta_sync_force_delete_shard_meta
comment is the strongest textual support I have that shard-meta retention drives FE heap to frequent Full GC, and that's a source comment, not a measurement of your heap.
jmap -histo
before any restart remains the arbiter. There is also no documented command to manually purge the recycle bin, and no per-object erase error reporting. If the gauges are flat with no matching log strings, this needs a GitHub issue with the gauge trend, log greps, and
histo.txt
— plus the community Slack for maintainer eyes. References • faq/shared_data_faq.md • knowledge/known_issues/shared_data.md (StarRocks knowledge base) • administration/management/monitoring/metric_details/q-r.md • administration/configuration/FE_parameters/stats_storage.md • faq/Others.md • sql-reference/information_schema/recyclebin_catalogs.md
q
@Rocky mysql> ADMIN SHOW FRONTEND CONFIG LIKE “catalog_trash_expire_second”; +-----------------------------+------------+-------+------+-----------+---------+ | Key | AliasNames | Value | Type | IsMutable | Comment | +-----------------------------+------------+-------+------+-----------+---------+ | catalog_trash_expire_second | [] | 1800 | long | true | | +-----------------------------+------------+-------+------+-----------+---------+ 1 row in set (0.01 sec) mysql> ^DBye [root@PRO-VTCL-16 ~]# curl -s localhost:8030/metrics | grep -E “recycle_bin_(table|partition|database)_num” HELP starrocks_fe_recycle_bin_table_num number of tables in the catalog recycle bin TYPE starrocks_fe_recycle_bin_table_num gauge starrocks_fe_recycle_bin_table_num 72073 HELP starrocks_fe_recycle_bin_partition_num number of partitions in the catalog recycle bin TYPE starrocks_fe_recycle_bin_partition_num gauge starrocks_fe_recycle_bin_partition_num 116462 HELP starrocks_fe_recycle_bin_database_num number of databases in the catalog recycle bin TYPE starrocks_fe_recycle_bin_database_num gauge starrocks_fe_recycle_bin_database_num 0
r
This settles it
catalog_trash_expire_second = 1800
— not the 86400 default. So your bin should hold at most 30 minutes of drops. You have entries aged 73 days (partition) and 10 days (table). That's ~3,500× the configured retention. Erase has been accomplishing nothing since at least 2026-09-06. The 376-cycle arithmetic I gave you last time is irrelevant — it assumed cycles were working.
database_num = 0
also confirms this is purely table/partition churn, no
DROP DATABASE
involved. Two corrections to earlier suggestions 1. Snapshot — dead end. Enabled=false, no jobs. Can't be revived. 2.
Failed to get delete tablet response... 600000ms
(BE memory spike during bulk tablet deletion) is documented fixed in 4.1.7 — your build. So that specific failure shouldn't be blocking you; if it's in your log it predates the upgrade. Don't chase it. The shape of the data points somewhere specific Five volumes named raw/bronze/silver/gold reads as medallion layering. Combined with 116,462 recycled partitions against 1,087 live tablets in 17 schemas, that's a daily full-rebuild ETL —
INSERT OVERWRITE
. That's precisely the trigger scenario the stuck-bin known issue names: "daily full INSERT OVERWRITE producing overwritten partitions/tablets." One config you should look at alongside the one you already changed: partitions replaced by INSERT OVERWRITE or MV rewrite are governed by
partition_recycle_retention_period_secs
(documented default 1800), not
catalog_trash_expire_second
. Note that's the same 1800 you have set — likely not a coincidence. Check it too, but either way, 73 days is not a retention setting. Two mechanisms remain A. Shared-directory skip — best fit for the partitions. "When a partition's path does not end with its physical partition id, partition erase skips it and logs
Skipped remove possible directory shared by multiple partitions
."
A skipped entry is never removed — it sits in the bin forever, counted by the gauge. With five storage volumes and possible volume migrations, this is a plausible trigger. Grep that exact string. B. Leadership churn starving the erase loop — inference, unverified. The troubleshooting guide documents Full GC causing demotion: "if the duration of a single pause GC exceeds 30 seconds, or if there are frequent pause GCs exceeding 10 seconds, it will trigger a leader switch." At 99.9% GC threads you may be cycling leaders, interrupting erase cycles mid-flight. Grep for
transfer FE type from LEADER to UNKNOWN. exit
and
... to FOLLOWER. exit
. I could not find documentation stating that the recycle-bin erase checker runs only on the leader — that part is my inference, so treat B as a hypothesis to test, not a fact. If B holds, you have a self-sustaining loop: GC pressure → demotion → erase never completes → bin grows → more GC pressure. Order of operations (evidence before action) 1.
jmap -histo
first.
A restart does not clear this — the bin is persisted in the FE image and replays on startup, so you'd lose the heap snapshot and still have 188k objects. Capture the histogram, a gc log excerpt, and the gauge triple while the process is alive. 2. Grep the leader's
fe.log
for the five strings (two from A/B, plus
RPC timeout
,
Fail to read tablet_id=
). 3. Find and stop the churn. Newest drop is today 16:09.
grep -c "INSERT OVERWRITE\|DROP TABLE\|DROP PARTITION" fe.audit.log
, get the user/client. Draining while the tap runs won't converge — the guide's own Case 1 recovery is "stop the table creation and deletion jobs, restart the service." 4.
catalog_recycle_bin_erase_max_operations_per_cycle
500 → 2000–5000. Mind the documented caveat: "The erase operation holds a lock, so one batch should not be too large."
5. Switch the job to
FORCE
—
DROP TABLE t FORCE
,
ALTER TABLE t DROP PARTITION p FORCE
. In shared-data these go into the bin marked non-recoverable and are erased on the next cycles without waiting for retention. This is the real fix for steady-state. 6.
meta_sync_force_delete_shard_meta = true
— last resort, and only if step 3 confirms nothing is draining. The source comment describes your exact symptom: "actual data deletion might fail or timeout, and if shard meta is not deleted, the FE memory will grow, eventually cause fe frequently Full GC." Cost, verbatim: "the data files belonging to the shards or tablets cannot be automatically cleaned after this feature is enabled." With five volumes and heavy churn that could be a large amount of orphaned object storage, reclaimable only via
meta_tool.sh --operation=lake_datafile_gc
— run
--do_delete=false
first, and partition by partition, since the tool loads tablet metadata into memory and the docs warn it is slow and memory-hungry. Honest limits • I still cannot prove the bin is what's filling your 24 GB heap. 3.27 GB shallow can't; the tracker excludes referenced objects; the source comment on the force-delete flag is the closest textual support.
jmap -histo
is still the arbiter
and I'd want the result before committing to a destructive flag. • No documented command exists to manually purge the bin, and no per-object erase error reporting. • No documented config for the erase cycle interval exists — I searched and found none, so I can't tell you how to make cycles more frequent. If step 2 finds no matching log strings and the gauges stay flat on 4.1.7 with snapshot off and correct retention, this is a genuine bug and not a tuning problem: file a GitHub issue with the gauge trend, the four log greps,
histo.txt
and your
information_schema.recyclebin_catalogs
output, and raise it in the community Slack. References • administration/configuration/FE_parameters/stats_storage.md • faq/shared_data_faq.md • knowledge/known_issues/shared_data.md (StarRocks knowledge base) • faq/operation_maintenance_faq.md • knowledge/qa/shared_data_vacuum_and_storage_cleanup.md (StarRocks knowledge base) • knowledge/known_issues/fe_metadata.md (StarRocks knowledge base)
q
@Rocky This is a jmap command output
r
The output didn't come through — I only see the sentence. Nothing after it. Please paste it, and a couple of tips so it survives: •
jmap -histo:live <pid>
can dump tens of thousands of lines. If it got truncated, grab the top ~40 rows (the default sort is by bytes, descending) rather than the whole thing:
Copy code
jmap -histo <pid> | head -40
• Use
jmap -histo <pid>
without
:live
first if you want the fastest, least disruptive snapshot;
:live
forces a full GC to mark reachable objects, which on a heap at 99.87% old gen could take a long time and will block. Given your GC state, I'd start with plain
-histo
and only do
:live
if you specifically want to separate garbage from live data. • If
jmap
itself hangs or the attach fails (common when the JVM is in a GC spin),
jstat
is already working for you, and
jcmd <pid> GC.class_histogram
is the alternative to try. What I'll be looking for: 1. Does something match the recycle-bin classes —
CatalogRecycleBin
, or the shard-group / tablet metadata objects it retains (
ShardGroup
,
TabletMeta
,
PhysicalPartition
,
OlapTable
, etc.) — at a total far above the 3.27 GB shallow figure? That's the number that would confirm or kill my hypothesis that the bin retains a much larger object graph than the tracker reports. 2. Or does the heap instead show something with no relation to the bin — tens of millions of instances of small objects, string/byte arrays, or a leak in a different subsystem? That would redirect the whole investigation, and I'd rather know that now than keep tuning the bin. 3. The total row at the bottom, so I can compare against
-Xmx24576m
and see how much is genuinely live versus garbage churn. To be explicit about where I stand: the stuck bin is still unexplained, and
catalog_trash_expire_second = 1800
against 73-day-old entries means erase is definitely not completing. But whether that causes your heap exhaustion is still inference, and this histogram is the one piece of evidence that decides it. If it comes back with no bin-related classes at scale, I'll drop the bin theory and we start over on the heap — that's a real possibility, and I don't want to send you into
meta_sync_force_delete_shard_meta
(which permanently orphans object-storage files) on a guess.
q
@Rocky jmap -histo 54803 | head -40 num #instances #bytes class name (module) ------------------------------------------------------- 1: 96633413 4014060816 [B (java.base@21.0.9) 2: 73632751 1767186024 java.lang.String (java.base@21.0.9) 3: 484138 1231378472 [Ljdk.internal.vm.FillerElement; (java.base@21.0.9) 4: 35267363 846416712 java.lang.Long (java.base@21.0.9) 5: 14850829 748569792 [Ljava.lang.Object; (java.base@21.0.9) 6: 7079600 589215192 [Ljava.util.HashMap$Node; (java.base@21.0.9) 7: 14583063 583322520 java.util.LinkedHashMap$Entry (java.base@21.0.9) 8: 8033202 514124928 java.util.LinkedHashMap (java.base@21.0.9) 9: 5568240 490005120 com.starrocks.lake.LakeTablet 10: 5687511 455000880 com.starrocks.catalog.Column 11: 13712536 438801152 com.sleepycat.je.dbi.RecordVersion 12: 13702021 438464672 com.sleepycat.je.dbi.CursorImpl$LockStanding 13: 8743452 349738080 java.util.TreeMap$Entry (java.base@21.0.9) 14: 3063732 343137984 com.sleepycat.je.rep.txn.ReplicaThreadLocker 15: 9144988 292639616 java.util.HashMap$Node (java.base@21.0.9) 16: 11011416 264273984 java.util.ArrayList (java.base@21.0.9) 17: 6106466 244258640 com.sleepycat.je.DatabaseEntry 18: 5686905 227476200 com.starrocks.type.ScalarType 19: 3064133 220617576 com.sleepycat.je.dbi.CursorImpl 20: 4071498 195431904 java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync (java.base@21.0.9) 21: 2784104 178182656 com.staros.shard.Shard 22: 91323 159049432 [C (java.base@21.0.9) 23: 1521383 158223832 com.sleepycat.je.txn.BasicLocker 24: 3119516 149736768 com.google.gson.internal.LinkedTreeMap$Node 25: 7493275 119892400 com.starrocks.catalog.ColumnId 26: 2369850 113752800 java.util.HashMap (java.base@21.0.9) 27: 2784104 111364160 com.staros.replica.Replica 28: 4181099 100346376 java.util.concurrent.locks.ReentrantReadWriteLock (java.base@21.0.9) 29: 1090384 98961192 [J (java.base@21.0.9) 30: 3002007 96064224 java.util.concurrent.ConcurrentHashMap$Node (java.base@21.0.9) 31: 476654 91517568 com.starrocks.catalog.PhysicalPartition 32: 2791859 89339488 com.google.protobuf.MapField 33: 2785387 89132384 java.util.Collections$UnmodifiableMap (java.base@21.0.9) 34: 1542659 86388904 com.sleepycat.je.Cursor 35: 3072638 73743312 com.sleepycat.je.utilint.TinyHashSet 36: 3027996 72671904 java.util.Collections$UnmodifiableRandomAccessList (java.base@21.0.9) 37: 2929823 70315752 java.util.concurrent.CopyOnWriteArrayList (java.base@21.0.9) 38: 1048688 67116032 it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap
r
Confirmed — and the numbers are unambiguous This is not "no bin classes at scale." The live heap is dominated by exactly the objects the recycle bin retains: Rank | Class | Instances | Bytes | What it is 9 |
com.starrocks.lake.LakeTablet
| 5,568,240 | 490 MB | tablet metadata 21 |
com.staros.shard.Shard
| 2,784,104 | 178 MB | StarMgr shard meta 27 |
com.staros.replica.Replica
| 2,784,104 | 111 MB | StarMgr replica meta 31 |
com.starrocks.catalog.PhysicalPartition
| 476,654 | 92 MB | partition metadata 10 |
com.starrocks.catalog.Column
| 5,687,511 | 455 MB | table schema 18 |
com.starrocks.type.ScalarType
| 5,686,905 | 227 MB | one per column 25 |
com.starrocks.catalog.ColumnId
| 7,493,275 | 120 MB | column ids The entity counts map almost exactly onto your bin contents: • 5,687,511 Columns ÷ 72,073 recycled tables ≈ 79 columns per table. Exact fit — those are the schemas of your recycled tables. • 476,654 PhysicalPartitions ÷ 116,462 recycled partitions ≈ 4.1 sub-partitions each. • 5,568,240 LakeTablets ÷ 476,654 physical partitions ≈ 11.7 tablets each. You reported ~1,087 tablets in the live cluster. The heap holds 5.57 million. That's a factor of ~5,000, and the only place they can come from is the 116k recycled partitions. The bin theory is no longer inference — this is the memory. The
[B
(4.01 GB / 96.6M instances),
String
(1.77 GB / 73.6M),
LinkedHashMap
(8.0M instances) and
Long
(35.2M) rows above them are the payload hanging off those entities, not an independent leak.
PhysicalPartition
,
Shard
,
Replica
are the StarMgr-side metadata too — which is precisely what
meta_sync_force_delete_shard_meta
gates. One caveat on the method Plain
jmap -histo
doesn't force a GC, so counts include uncollected garbage. It doesn't matter here: old gen sat at 99.87% across 35 full GCs (120 s total), so these objects already survived 35 collection attempts. They are effectively live. The top 40 rows alone account for ~17.5 GB of your 24 GB. Two secondary findings `jdk.internal.vm.FillerElement`: 484,138 instances, 1.23 GB (#3). These are G1 filler objects placed when humongous allocations can't be satisfied. A healthy heap has almost none; 1.23 GB of them means large-array allocations are repeatedly failing against a fragmented, nearly-full heap. Symptom, not cause — but further evidence the heap is in trouble. A ~2 GB BDB JE block I can't explain: 13.7M
RecordVersion
, 13.7M
CursorImpl$LockStanding
, 3.06M
ReplicaThreadLocker
, 3.06M
CursorImpl
, 1.54M
Cursor
, 6.1M
DatabaseEntry
, 1.5M
BasicLocker
. That works out to ~1.54M live JE cursors, each with a CursorImpl and a thread locker. I do not have an explanation for that and I'm not going to invent one — flag it in the GitHub issue, because it may be a second, separate leak. Also worth noting your
jstat
had M at 98.48% and CCS at 92.71%; that is used-vs-committed metaspace, which expands on demand, so it's not necessarily a ceiling — but it's worth a glance. What to do, in order Do not restart first. The bin is persisted in the FE image and replayed on startup — you'd reload all 188k objects and land in the same place, minus your evidence. Drain first. 1.
ADMIN SET FRONTEND CONFIG ("meta_sync_force_delete_shard_meta" = "true");
— also add it to
fe.conf
so it survives restart. This is the exact scenario the docs gate the flag on: "only when there is an excessive number of shards to be cleaned, which leads to extreme memory pressure on the FE JVM." Your shard-meta counts (2.78M Shard + 2.78M Replica) are the thing it's designed to release. 2. `catalog_recycle_bin_erase_max_operations_per_cycle`: 500 → 2000–5000. 188k objects at 500/cycle is 376 cycles. Keep the documented caveat in mind: "the erase operation holds a lock, so one batch should not be too large" — start at 2000, not 5000, since your cluster is already hanging on locks.
3. Switch the ETL to `FORCE`:
DROP TABLE t FORCE
,
ALTER TABLE t DROP PARTITION p FORCE
. In shared-data these enter the bin as non-recoverable and are erased on the next cycles without waiting for retention. This is the real steady-state fix; your
catalog_trash_expire_second
is already 1800, so retention tuning buys you nothing. 4. Stop or throttle the source. Newest drop was 16:09 today — something is still churning. 5. Watch
recycle_bin_partition_num
/
recycle_bin_table_num
fall.
When they're near zero, the 5.57M LakeTablets and 2.78M shards go with them. Then, if heap stays fragmented, restart. 6. Reclaim the orphaned object storage afterwards with
meta_tool.sh --operation=lake_datafile_gc
.
--do_delete=false
first
, and partition by partition, not cluster-wide — the tool loads tablet meta into memory, and the docs warn it is slow and memory-hungry. With five volumes and heavy churn this is the real cost of step 1. Honest limits • I can't prove the `[B`/`String` bytes belong to the bin without a retained-size analysis; the entity counts are the proof, the byte attribution is inference. • Draining 188k objects will produce a large volume of journal entries. I'd expect checkpoint work and journal growth to spike during the drain and a Full GC or two — that's my inference, not documented behavior. Keep
SHOW PROC '/journal'
and the
.jdb
directory size in view while it runs. • No documented way exists to purge the bin manually, and no per-object erase error reporting. If the gauges stay flat even with the force-delete flag on, that's a bug: GitHub issue with this histogram, the gauge triple, your
jmap
output and the earlier log greps — and raise it in the community Slack, because the JE cursor count needs a maintainer's eyes. References • administration/Meta_recovery.md • administration/configuration/FE_parameters/shared_lake_other.md • faq/shared_data_faq.md • knowledge/admin_and_operation/shared_data_garbage_cleanup.md (StarRocks knowledge base) • best_practices/fe_memory_troubleshooting.md • knowledge/trouble_shooting/fe_memory_problems.md (StarRocks knowledge base)
q
@Rocky How to know a table was force deleted or just deleted normal?
r
Short answer: there is no documented SQL way. Nothing in the recycle bin's queryable surface exposes whether an entry came from
DROP ... FORCE
or a normal
DROP
. What is actually queryable
information_schema.recyclebin_catalogs
has exactly six columns —
TYPE
,
NAME
,
DB_ID
,
TABLE_ID
,
PARTITION_ID
,
DROP_TIME
. No recoverability flag, no drop mode.
SHOW PROC
has no recycle-bin path either (the documented set is
/backends
,
/dbs
,
/jobs
,
/frontends
,
/catalog
, etc. —
/dbs
shows live databases only). So
SELECT * FROM information_schema.recyclebin_catalogs
genuinely cannot tell you. There's also a trap here worth flagging: in shared-data a
FORCE
-dropped table still appears in the bin — the docs describe it as "put in the recycle bin as not recoverable and is only queued there for file deletion." So presence in the bin does not imply "normal drop." The reliable evidence is the audit log
fe.audit.log
records statement text.
enable_audit_sql
defaults to
true
, so unless it was turned off you can grep the literal SQL:
Copy code
grep -iE "DROP (TABLE|DATABASE|PARTITION).*FORCE" fe.audit.log*
And note that partition drops go through
ALTER TABLE ... DROP PARTITION [IF EXISTS] <p> [FORCE]
— the partition docs confirm "If FORCE is specified, the partitions will be deleted directly … and they cannot be recovered." So grep for
DROP PARTITION
too, not just
DROP TABLE
. Two caveats, and they matter for your case: 1. Retention.
audit_log_delete_age
defaults to 7 days and
audit_log_roll_num
to 90 files. Your bin entries span 73 days. The audit log almost certainly does not reach back far enough to classify the bulk of your 188k objects. 2. If
enable_audit_sql
is
false
, ConnectProcessor replaces statement text with
"?"
and this approach gives you nothing.
RECOVER
is not a clean probe
You might think to try
RECOVER TABLE x
and infer from failure. I'd avoid treating that as a test: the docs don't state what happens on a force-dropped object, and I won't guess. Also, failure doesn't isolate
FORCE
— it could equally mean the retention window passed, or an object with the same name was recreated ("If the metadata is deleted with identical metadata created, the previous one will not be recovered"). Ambiguous result, no clean signal. An important nuance about the flag itself Even if some internal surface did expose recoverability, it would not be a pure
FORCE
marker. Per the source description I have, an entry is marked not-recoverable when a
FORCE
drop happens, or when
TRUNCATE
removes old partitions, or when a same-name object is created after the drop. So "not recoverable" ≠ "was dropped with FORCE." Three different causes collapse into one state. What this means for your specific problem You cannot retroactively classify the existing 188k entries. And skipping that doesn't cost you anything, because the classification doesn't change the fix: force-dropped and TRUNCATE'd objects are erased on the next cycles without waiting, and normal drops wait
catalog_trash_expire_second
— which you've set to 1800 s. Nothing in your bin should be older than 30 minutes under either mode, yet entries are 73 days old. The erase path is broken across the board, so per-entry mode is not the discriminator. Also relevant to your 116,462 partitions: they may not be force-drops at all. The docs say partitions replaced by
INSERT OVERWRITE
or MV rewrite
use
partition_recycle_retention_period_secs
(default 1800) — a separate origin from
DROP PARTITION
. That fits a daily full-rebuild ETL better than explicit
DROP ... FORCE
. Forward-looking instead: 1.
grep -c FORCE fe.audit.log*
— tells you whether your ETL uses
FORCE
at all, which is the thing you actually need to decide step 5 from earlier (switching the job to
FORCE
). 2.
grep -iE "INSERT OVERWRITE|DROP PARTITION" fe.audit.log* | head
— identifies the job and user doing the churn.
3. If you need this answer routinely in future, the only durable approach is in the ETL itself: log which statement form you issued, or use distinct table naming per mode. StarRocks doesn't give you a post-hoc way to ask. I want to be explicit that my check was against the documented field lists, not an exhaustive read of the FE source. If a maintainer confirms an internal way to inspect the per-entry recoverable state, that would be worth adding to the GitHub issue alongside the histogram. References • sql-reference/information_schema/recyclebin_catalogs.md • administration/Data_recovery.md • faq/shared_data_faq.md • knowledge/qa/shared_data_backup_restore_options.md (StarRocks knowledge base) • administration/configuration/FE_parameters/stats_storage.md • sql-reference/sql-statements/backup_restore/RECOVER.md
q
@Rocky How about the case with create table as select?
r
CTAS itself never touches the recycle bin
CREATE TABLE AS SELECT
is purely a create — it queries, creates a table, inserts. Nothing is dropped, so nothing is queued for erasure. Same for async
SUBMIT TASK AS CREATE TABLE ... AS SELECT
. There is no
FORCE
keyword in the CTAS syntax at all (
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] ... AS SELECT
), so "was this CTAS force-deleted" isn't a question with an answer. So the real question is about the DROP that accompanies it — the
DROP TABLE target
your ETL must run before (or after) re-running CTAS. That statement is an ordinary drop, and everything from my previous reply applies unchanged: no column in
information_schema.recyclebin_catalogs
records the mode, and
fe.audit.log
is the only place the
FORCE
keyword appears. But there's a CTAS-specific consequence that does matter Different from an overwrite-style pipeline: CTAS loops almost always reuse the same table name. That triggers the same-name rule — "If the metadata is deleted with identical metadata created, the previous one will not be recovered" (in the source, the older entry gets marked not-recoverable). A not-recoverable entry is erased on the next cycles without waiting for retention. Two implications, and I'll label them: • Inference: a plain
DROP
+ CTAS loop on the same name should self-drain within a few erase cycles, not sit for 73 days. So if your ETL is genuinely drop→CTAS on a fixed name, your stuck entries point even harder at the erase path being broken rather than at retention being too long. • Consequence for your partitions: CTAS creates a table; it does not produce the
INSERT OVERWRITE
/ MV-rewrite partition recycling that uses the separate
partition_recycle_retention_period_secs
(1800) origin. So a CTAS-based job would not explain 116,462 recycled partitions at all — those would have to come from
ALTER TABLE ... DROP PARTITION
or overwrites elsewhere in the pipeline. Worth checking which of the two your pipeline actually does, because it changes the diagnosis:
grep -iE "CREATE TABLE ._ AS SELECT|DROP PARTITION|INSERT OVERWRITE" fe.audit.log_ | head -50
. The pattern that avoids the problem If you're rebuilding tables with CTAS, prefer atomic swap over drop-then-create —
ALTER TABLE ... SWAP WITH <tbl_name>
is documented as an atomic exchange of two tables, and it's a synchronous operation. Build into a side table, swap, then drop the now-displaced table with `FORCE`:
Copy code
sql
CREATE TABLE target_new AS SELECT ... FROM source;
ALTER TABLE target SWAP WITH target_new;
DROP TABLE target_new FORCE;
Constraints I can confirm from the docs:
SWAP WITH
must be same database (cross-database swap fails with _"Table site_access1 does not exist or is not OLAP/LAKE table"_), Unique/Key constraints are validated, and dependent materialized views are set inactive and lose their constraint metadata. The final
DROP ... FORCE
never enters the bin, so nothing accumulates — which is exactly what you want given the 5.57M
LakeTablet
objects are traceable to bin entries. Given your earlier state, one caveat on that last step:
FORCE
drops release the files without the retention wait, but the shard metadata release is what
meta_sync_force_delete_shard_meta
governs — so keep that flag on while draining. For async CTAS specifically
SUBMIT TASK AS CREATE TABLE ... AS SELECT
records the statement text in
information_schema.tasks.DEFINITION
(the doc example shows an
EXPIRE_TIME
three days out), so you can see the CTAS definition itself — but again, not the accompanying
DROP
, and not whether it used
FORCE
. I checked the documented CTAS, ALTER TABLE, and recycle-bin surfaces rather than reading the FE source exhaustively, so if a maintainer knows an internal way to read an entry's recoverable state, that's worth appending to the GitHub issue. References
q
@Rocky How to force delete recyclebin_catalogs
r
There is no documented way to force-purge
recyclebin_catalogs
No SQL statement, procedure, or
ADMIN
command purges a bin entry on demand.
information_schema.recyclebin_catalogs
is a read-only view — six columns, no action surface.
ADMIN
statements don't reach the recycle bin. There's no `TRUNCATE`/`PURGE RECYCLEBIN`. And restarting won't help: bin entries are in the FE image and replayed on startup. The only documented path is make entries instantly erasable, then let the erase cycles run. Four mutable FE configs control that: Config | Default | Effect
catalog_trash_expire_second
| 86400 | Retention gate. Drop it and everything older than the new window becomes eligible.
catalog_recycle_bin_erase_max_operations_per_cycle
| 500 | Throughput. Erase holds a lock — "one batch should not be too large."
catalog_recycle_bin_erase_min_latency_ms
| 600000 | Floor on how long an object must sit before erasing — "avoids the erase log being written ahead of the drop log."
catalog_recycle_bin_erase_fail_retry_interval_ms
| 60000 | Backoff after a failed erase. Note the third one, the 10-minute floor: nothing gets erased faster than that regardless of retention, so it's a real limiter on drain speed even for
FORCE
-dropped objects. The ramp, for your case:
Copy code
sql
ADMIN SET FRONTEND CONFIG ("catalog_trash_expire_second" = "300");
ADMIN SET FRONTEND CONFIG ("catalog_recycle_bin_erase_min_latency_ms" = "60000");
ADMIN SET FRONTEND CONFIG ("catalog_recycle_bin_erase_max_operations_per_cycle" = "2000");
Then watch
starrocks_fe_recycle_bin_table_num
/
_partition_num
. Raise
max_operations
to 5000 only if the gauges move steadily and lock waits stay tolerable. Put the values in
fe.conf
too or they revert on restart. Set
catalog_trash_expire_second
to a small value like 300, not 0.
Zero means any accidental drop is unrecoverable for as long as it's set, and I have no doc saying 0 is handled as "erase immediately" versus something degenerate. Revert both retention configs once drained — leaving them at 300 permanently means no meaningful
RECOVER
window. Lowering
catalog_recycle_bin_erase_min_latency_ms
carries the ordering risk its own comment warns about; it's the one to revert first. Your bin has a specific reason not to drain — check these first 1. Same-name partition recycling bug. This is the one I'd check. Known issue: "Recycled partitions with the same name stay stuck in the recycle bin permanently" — partitions never leave when same-name partitions keep being added at intervals shorter than the retention period, because "their retention countdown is restarted each time." Fixed in 4.1.0, 4.0.7, 3.5.15. You're on 4.1.7, so you should have the fix — but your symptom profile (daily rebuild loop, 116k partitions, 73-day
DROP_TIME
spread) is an exact match for it. Confirm every FE node actually runs 4.1.7; a stale follower during the 4.1.0→4.1.7 upgrade, or a rollback, would put you back in the buggy path. The fix also addressed "some same-name recoverable partitions are left still marked recoverable because the scan stops after the first matching entry" — which is why your force-delete flag may not be releasing as expected. 2. Snapshot blocking — ruled out. That failure mode needs automated cluster snapshot enabled with no
FINISHED
job (fixed 4.1.2, and you're on 4.1.7). Your
ADMIN SHOW AUTOMATED CLUSTER SNAPSHOT
shows
Enabled = false
, so this isn't your blocker. 3. Shared directory skip. If a partition's path doesn't end with its physical partition id, partition erase skips it and logs
Skipped remove possible directory shared by multiple partitions
. Grep
fe.log
for this — a silent permanent skip would explain flat gauges. Worth doing before you conclude the erase path is broken.
4. Erase failures. Separate from the skip: failures retry on
catalog_recycle_bin_erase_fail_retry_interval_ms
forever, so a persistently failing erase produces a flat gauge with no user-visible error.
grep -iE "erase|recycle.*fail" fe.log
. 5. The pre-4.1.0 memory bug — "after a partition has already been successfully deleted, its information is still retained in memory instead of being released" — fixed in 4.1.0. Also off the table on 4.1.7, same version caveat as above. Blunt summary The gauges are your only progress signal, and they only prove movement — they won't tell you why an entry stalled. So: grep for the skip message and erase failures first, because if #3 or #4 applies, no amount of config ramping will drain the bin, and you'd be tuning throughput against a wall. If nothing is logged and the gauges still don't move after retention and latency are lowered, that's a bug report to GitHub with the skip/failure grep output, the gauge triple, and your
jmap
histogram. I'll be honest that I found no documented manual purge, and I'm not going to suggest editing the image or JE logs directly — that's unsupported and risks metadata damage. If a maintainer knows an internal erase trigger, that's the question to ask in the GitHub issue; for a 24 GB FE on 4 nodes with this much metadata, it may also be worth asking CelerData support. References • administration/configuration/FE_parameters/stats_storage.md • faq/operation_maintenance_faq.md • sql-reference/information_schema/recyclebin_catalogs.md • administration/Data_recovery.md • administration/management/monitoring/metric_details/q-r.md • knowledge/known_issues/fe_metadata.md (StarRocks knowledge base)