GreptimeTeam / greptimedb

An open-source, cloud-native, unified time series database for metrics, logs and events with SQL/PromQL supported. Available on GreptimeCloud.
https://greptime.com/
Apache License 2.0
4.39k stars 317 forks source link

Drop table doesn't clear data files #5071

Closed adminpass closed 1 day ago

adminpass commented 3 days ago

What type of bug is this?

Data corruption

What subsystems are affected?

Storage Engine

Minimal reproduce step

DROP TABLE table

What did you expect to see?

The table data directory will be cleared

What did you see instead?

It has been marked as .dropping, but it has not been deleted yet image

What operating system did you use?

Windows 10 x64

What version of GreptimeDB did you use?

v0.10.2

Relevant log output and stack trace

No response

evenyag commented 3 days ago

This is expected. The dropping marker indicates that the database will remove these files later. The file deletion is delayed after a GC period, typically 5 minutes.

https://github.com/GreptimeTeam/greptimedb/blob/6308e86e218ac2d257b15406113dd5d905dcd677/src/mito2/src/worker/handle_drop.rs#L133-L136

Maybe we can do the first check immediately or after a small interval, like several seconds.