Title
#users-public
s

Sherwin Mascarenhas

09/30/2022, 12:14 PM
Hi everyone, I am having a bit of trouble truncating data from a table as inserts are taking place simultaneously into the table via TCP/ILP. I get the following error: table 'table_name' could not be truncated: [0]: table busy [reason=tcpIlp] Apart from stopping the service to truncate the data is there another way that this can be achieved?
Andrey Pechkurov

Andrey Pechkurov

09/30/2022, 2:07 PM
Hi Sherwin, You could try dropping partitions:https://questdb.io/docs/reference/sql/alter-table-drop-partition/ Keep in mind that the latest partition can't be dropped this way, so it's not exactly same as what TRUNCATE does.
s

Sherwin Mascarenhas

09/30/2022, 2:08 PM
Hi Andrei, I did try dropping a day partition for today but I think that won't work, since, data is still being written to today's partition
Andrey Pechkurov

Andrey Pechkurov

09/30/2022, 2:11 PM
yes, the latest one can't be dropped
2:11 PM
you'd have to stop the ingestion and TRUNCATE the table if you need to drop it
s

Sherwin Mascarenhas

09/30/2022, 2:11 PM
Yup, I guess that would be the only option
Andrey Pechkurov

Andrey Pechkurov

09/30/2022, 2:33 PM
Feel free to upvote this issue: https://github.com/questdb/questdb/issues/2529
Nicolas Hourcard

Nicolas Hourcard

09/30/2022, 4:14 PM
hi @Sherwin Mascarenhas welcome
4:14 PM
are you able to share your use case at a higher level?
s

Sherwin Mascarenhas

09/30/2022, 4:22 PM
@… so I deployed a service that persists metrics to quest db, using TCP/ILP today, to a table that is partitioned by day. But that service started sending incorrect metrics, due to which we decided to erase all the data persisted to that table today, and redeploy the service with a fix. But as mentioned we could not truncate any data as the table writer was busy and could not drop the latest partition created as well.
Nicolas Hourcard

Nicolas Hourcard

09/30/2022, 4:28 PM
thank you