Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: Cleanup states for dropped TABLEs/MVs #2908

Closed
hzxa21 opened this issue May 30, 2022 · 7 comments
Closed

storage: Cleanup states for dropped TABLEs/MVs #2908

hzxa21 opened this issue May 30, 2022 · 7 comments
Assignees

Comments

@hzxa21
Copy link
Collaborator

hzxa21 commented May 30, 2022

We already support DROP TABLE and DROP MATERIALIZED VIEW in frontent and meta but the data belonging to dropped tables/mvs still remain on storage occupying storage spaces and participating in compaction.

We should support state cleanup for dropped TABLEs/MVs. One feasible solution is to delete states via a compaction filter.

Related issues:
#191
#201
#1153
#1212
#1272

@neverchanje
Copy link
Contributor

neverchanje commented May 30, 2022

I used to think that we rely on background compaction (vacuum) to remove the data because the table is basically a prefix on large shared storage, right? So we can not drop the files immediately after dropping the table. So the question is, will the compaction processes remove the data with zero reference count?

@hzxa21
Copy link
Collaborator Author

hzxa21 commented May 30, 2022

I used to think that we rely on background compaction (vacuum) to remove the data because the table is basically a prefix on large shared storage, right? So we can not drop the files immediately after dropping the table.

Right. Data of dropped table/mv should be invisible to user immeidately but should be cleaned up asynchorously via background compaction.

@twocode
Copy link
Contributor

twocode commented May 30, 2022

@mikechesterwang This looks like to be one of your requirements.

@TennyZhuang
Copy link
Contributor

BTW different MVs may share the same arrangement, so the real drop happens on the arrangement.

@skyzh
Copy link
Contributor

skyzh commented May 31, 2022

Streaming and Meta part:

  • Change all node to use table id as prefix, remove executor and shared prefix streaming: use table_id as topN prefix #2925
  • Record table id belonging to a MV on meta (optional)
  • Record drop prefix on drop MV / drop table / drop index

Storage part:

  • Implement drop prefix compaction filter

@skyzh
Copy link
Contributor

skyzh commented May 31, 2022

cc @Li0k may help change all stateful executors to use table id, and record all tables in one MV, before proceeding to implement compaction filter.

@hzxa21
Copy link
Collaborator Author

hzxa21 commented Jun 9, 2022

#3038 resolves this issue.

@hzxa21 hzxa21 closed this as completed Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants