Kylo Subedi
08/20/2025, 7:05 AMTRUNCATE TABLE is giving following error:
ERROR 1064 (HY000): Partition [$shadow_automatic_partition] is changed during truncating table, please retry
But while directly connecting to one of the FE Nodes and executing the same query, the query resolves. Any configuration or changes that I need to make to make this work?
Also, I am using shared-data mode with 3 FE Nodes and 3 CN nodes.JOSE PUERTOS TAVARES
08/20/2025, 1:41 PMAI Overview
The error message "Partition [p20240315] is changed during truncating table, please retry" in StarRocks suggests a conflict during the truncate operation, most likely caused by concurrent operations on the same table or partition.
Here's why you might encounter this error and what to do:
Why it happens
Concurrent operations: Another process (e.g., data loading, schema change, or another truncate) is modifying the table or the specific partition you're trying to truncate at the same time.
StarRocks needs a consistent state: TRUNCATE TABLE operations in StarRocks require the table or partition to be in a consistent state without other modifications occurring simultaneously.
How to address the issue
Retry the truncate operation: This error message specifically recommends retrying. It's possible the conflict was transient.
Ensure no concurrent operations:
Check for ongoing data loads: If you have data loading tasks running, wait for them to complete before truncating.
Check for schema changes: You cannot perform TRUNCATE TABLE on a table with a schema change in progress. Wait for the schema change to complete.
Verify no other truncates or DDL operations: Make sure no other truncate operations or Data Definition Language (DDL) operations are running on the same table or partition.
Consider using DELETE for concurrent access needs: If you require concurrent access to a table while clearing data, you might consider using the DELETE statement with a WHERE clause, though it can be slower for large tables compared to TRUNCATE. However, be aware of the restrictions on concurrent deletes in StarRocks.
Review StarRocks Best Practices for data ingestion and lifecycle: According to StarRocks Best Practices, using TRUNCATE is recommended over DELETE for data deletion. However, ensure to follow guidelines regarding concurrent operations to avoid such errors.
Check StarRocks logs for details: If the problem persists, examine the StarRocks logs (FE detailed logs and BE logs like be.INFO) for more specific information about the operations causing the conflict.
Important Note: TRUNCATE TABLE directly deletes data and it cannot be recovered.Kylo Subedi
08/20/2025, 2:34 PMJOSE PUERTOS TAVARES
08/20/2025, 2:36 PMKylo Subedi
08/20/2025, 2:37 PMKylo Subedi
08/20/2025, 2:37 PMKylo Subedi
08/20/2025, 2:38 PMKylo Subedi
08/20/2025, 2:38 PMJOSE PUERTOS TAVARES
08/20/2025, 3:10 PM