I’ve got the latest version of influxdb (1.8) on Windows Server.
I want to delete a measurement, which is the biggest of my db, ~9GB out of a 14GB total.
I ran the command:
DROP MEASUREMENT my_measurement
but it was taking forever to complete, so after an hour I stopped it.
note that I have no telegraf instance writing data (and therefore re-creating it)
Another thing I tried is the measurement bulk delete available through influx_inspect utils, which offers a command
deletetsm to bulk delete a measurement from raw tsm files.
The command didn’t complete successfully, for an “access denied” error when it tries to replace the original tsm file with the temporary it creates, so I replaced the files manually and looks like it worked.
(the command creates a new “tsm.something.tmp” file without the deleted measurement, and then does overrides the original one, here I get the error access denied even if I’m using the admin account)
here is the command:
PS C:\Monitoring\influxdb> .\influx_inspect.exe deletetsm -measurement sqlserver_requests .\SqlServerGT\data\monitor\short\31\000001971-000000002.tsm
and its error:
deletetsm: rename .\SqlServerGT\data\monitor\short\31\000001971-000000002.tsm.rewriting.tmp .\SqlServerGT\data\monitor\short\31\000001971-000000002.tsm: Access is denied.
After restarting the influxDB service I checked if the service was still there… and it is.
Looks like I’m unable to get rid of it.
Now I just left the “DROP MEASUREMENT” command running and will check tomorrow if it completes.
Have you ever faced this kind of issue?
Update:
The “DROP MEASUREMENT” command completed, I can’t say how much time it took but it was surely more than 2:30h
What’s the quickest way to drop a measurement?