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

fix: Run delete table jobs after tables are removed from catalog #1437

Merged
merged 3 commits into from
Aug 1, 2023

Conversation

scsmithr
Copy link
Member

Otherwise the user could end up in a situation where table data was deleted, but the table still exists in the catalog if the request to mutate the catalog failed.

Otherwise the user could end up in a situation where table data was deleted, but
the table still exists in the catalog if the request to mutate the catalog
failed.
@scsmithr scsmithr requested a review from adhish20 July 31, 2023 20:43
Comment on lines +312 to +313
# Note that this doesn't guarantee that we drop data in the correct order since
# we don't have a guarantee on when the background job runs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't really guarantee that the data isn't dropped here either. Maybe the background job hasn't still run 🤔

Does this test error on main?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this was the easiest test case to write, but definitely not comprehensive.

I was able to get this to fail on main. It was easier to repeat when running locally:

GlareDB (v0.2.1)
Type \help for help.
Using in-memory catalog
〉\open db
Created new session. New database path: db
〉create table drop_data_check as values (1);
create table
〉drop table drop_data_check, table_does_not_exist;
Error: Failed Metastore request: Missing database object; schema: public, name: table_does_not_exist
〉select * from drop_data_check;
Error: Error during planning: Unable to fetch table provider for 'drop_data_check': Failed to create table provider for 'drop_data_check': Not a Delta table: No snapshot or version 0 found, perhaps /Users/sean/Code/github.com/glaredb/glaredb/db/databases/00000000-0000-0000-0000-000000000000/tables/20000/ is an empty dir?

@scsmithr scsmithr requested a review from vrongmeal August 1, 2023 12:32
@scsmithr scsmithr enabled auto-merge (squash) August 1, 2023 17:00
@scsmithr scsmithr merged commit 367c5ff into main Aug 1, 2023
@scsmithr scsmithr deleted the sean/job-drop-order branch August 1, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants