Garbage Collection (GC)
GreptimeDB GC delays physical deletion of SST/index files until all references (running queries, repartition cross-region file refs) are released. The configuration contains two parts:
- Metasrv Configuration
- Datanode Configuration
How it works
- Roles: Meta decides when/where to clean; datanodes perform the actual delete while keeping in-use files safe.
- Safety windows:
lingering_timeholds known-removed files a bit longer;unknown_file_lingering_timeis a rare-case guard. - Listing modes: Fast mode removes files the system already marked; full listing walks storage to catch stragglers/orphans.
Metasrv Configuration
On the Metasrv side, GC schedules cleanup tasks for regions and coordinates when to run GC.
[gc]
enable = true # Enable meta GC scheduler. default to be false; must match datanode.
gc_cooldown_period = "5m" # Minimum gap before the same region is GCed again.