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

drop tables doesn't delete native table files. #1870

Closed
universalmind303 opened this issue Oct 2, 2023 · 2 comments · Fixed by #2415
Closed

drop tables doesn't delete native table files. #1870

universalmind303 opened this issue Oct 2, 2023 · 2 comments · Fixed by #2415
Assignees
Labels
bug Something isn't working
Milestone

Comments

@universalmind303
Copy link
Contributor

Description

files are not dropped when tables are dropped.
likely related to #1855

> \open ./db
> create table t1 (a int, b int);
try_insert_table_namespace
Table created
> insert into t1 values (1, 2);
Inserted 1 row
> select * from t1;
┌───────┬───────┐
│     a │     b │
│    ── │    ── │
│ Int32 │ Int32 │
╞═══════╪═══════╡
│     1 │     2 │
└───────┴───────┘
> drop table t1;
Table(s) dropped
> Ctrl+D
glaredb  ❯ ls db/databases/00000000-0000-0000-0000-000000000000/tables/                                                                                                                       10/02/2023 04:14:11 PM
╭───┬────────────────────────────────────────────────────────────────┬──────┬───────┬──────────────╮
│ # │                              name                              │ type │ size  │   modified   │
├───┼────────────────────────────────────────────────────────────────┼──────┼───────┼──────────────┤
│ 0 │ db/databases/00000000-0000-0000-0000-000000000000/tables/20000 │ dir  │ 128 B │ a minute ago │
╰───┴────────────────────────────────────────────────────────────────┴──────┴───────┴──────────────╯
@universalmind303 universalmind303 added the bug Something isn't working label Oct 2, 2023
@scsmithr
Copy link
Member

scsmithr commented Oct 3, 2023

Is there anything inside that directory? We have #1411 open for not deleting the directory itself though (only for local, s3/gcs work as expected I believe).

@universalmind303
Copy link
Contributor Author

it doesn't delete any of the files

image

@universalmind303 universalmind303 added this to the next milestone Jan 10, 2024
@universalmind303 universalmind303 self-assigned this Jan 11, 2024
universalmind303 added a commit that referenced this issue Jan 23, 2024
closes #1870

I wanted to open this up to make sure that others are aligned on the
direction I took with this before getting too far. This works as is, but
could use a bit of cleanup in areas.



It uses our scheduler to spawn a system_exec to remove the delta tables.
Currently it just logs the output, but we could put them in a table or
something else.. Logging seemed to be fine for now.. I didn't want to
over-engineer and throw away a bunch of work if this isn't the direction
we want to take.

---------

Co-authored-by: Vaibhav Rabber <vrongmeal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants