Hello, I am using ProxySQL for load balancing. But...
# questions-and-troubleshooting
k
Hello, I am using ProxySQL for load balancing. But
TRUNCATE 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.
j
I was curious and this came from Google AI.. are you trying to truncate a specific partition or multiple tables?
Copy code
AI 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.
k
this needed different configuration on proxysql side
🆒 1
j
Cool, what did you change? Stickiness ? Might be helpful for someone in the future even more now that seems AI is in slack and makes it easier to query past posts
k
yeah added some query rules on proxy side and fixed it.
yay 1
but my dbt models are stucked in run state for hours which would take few seconds.
don't know what's the issue.
I am trying to debug since hours.
j
Ah not familiar with dbt , we are using Apache Beam so we get metrics from the engine itself as it progress elements and such