<@U0A71G31CDV> how do you cleanup old/stale delvec...
# questions-and-troubleshooting
j
@Rocky how do you cleanup old/stale delvec and del files in s3 using a shared-data deployment? is there a config on this?
r
In a StarRocks shared-data (compute-storage separation) deployment, the cleanup of old or stale files like
.delvec
(Delete Vectors),
.del
(Delete files), and
.segment
files in S3 is primarily handled by the AutoVacuum mechanism. How Cleanup Works When a Compaction task runs in a shared-data cluster, it merges multiple versions of data into new rowsets. The old rowsets, along with their associated delete vectors and delete files, are no longer referenced by the latest metadata. 1. Compaction: Triggered by the FE and executed by the CN. It creates new versions of data. 2. AutoVacuum: This is the garbage collection process specifically for shared-data. It periodically scans for files in the object storage (S3) that are no longer referenced by any active tablet metadata and deletes them. Key Configurations (FE) You can tune the cleanup behavior using the following Frontend (FE) configuration parameters (many are dynamic and can be set via
ADMIN SET FRONTEND CONFIG
): *
lake_autovacuum_grace_period_minutes
: * Default: 30 (since v3.3.0/v3.2.5/v3.1.10; previously 5). * Description: Determines how long historical data versions are kept before being eligible for deletion. You should ensure this is longer than your longest-running query to prevent data from being deleted while a query is still reading it. *
lake_autovacuum_parallel_partitions
: * Default: 8 * Description: The maximum number of partitions that can undergo AutoVacuum simultaneously. *
lake_autovacuum_partition_naptime_seconds
: * Default: 180 * Description: The interval between vacuum checks for the same partition. *
lake_autovacuum_stale_partition_threshold
: * Default: 12 (hours) * Description: If a partition has not had any updates (loads or compactions) within this time, the system stops performing AutoVacuum on it to save resources. Manual Cleanup for Legacy Versions In versions older than 3.1.8 or 3.2.3, there were cases where failed ingestion or compaction tasks could leave "garbage" data in S3 that wasn't automatically cleaned up. If you find a large volume of stale files that aren't being removed, StarRocks provides a manual garbage collection tool called
lake_datafile_gc
. Tool Usage Example:
Copy code
bash
./bin/meta_tool.sh --operation=lake_datafile_gc \
    --root_path="<s3://your-bucket/starrocks_path>" \
    --expired_sec=86400 \
    --conf_file=./conf/be.conf \
    --do_delete=false
*
--do_delete=false
: Always run with
false
first to audit what will be deleted. *
--expired_sec
: Only clean files older than this duration (e.g., 86400 for 24 hours) for safety. Summary of Recommendations * Check Version: If you are on a recent version (v3.2.5+, v3.3.0+), AutoVacuum should handle this automatically. * Adjust Grace Period: If your S3 costs are high due to old versions, you can lower
lake_autovacuum_grace_period_minutes
, but keep it above your max query duration. * Monitor Compaction: Ensure compaction is running successfully (
SHOW PROC '/compactions'
), as AutoVacuum only cleans up data that has been successfully compacted into new versions. Referencesknowledge/admin_and_operation/shared_data_garbage_cleanup.mdfaq/operation_maintenance_faq.mdknowledge/admin_and_operation/shared_data_compaction.md