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

refactor: add DatabaseMeta.gc_in_progress #16464

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Sep 18, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

refactor: add DatabaseMeta.gc_in_progress

If gc_in_progress is set, no un-drop can be done on this database.
Because the related data may already have been deleted.

This commit does not use this flag yet, and will be used in next commit.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Refactoring

Related Issues


This change is Reviewable

@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Sep 18, 2024
@drmingdrmer drmingdrmer marked this pull request as ready for review September 18, 2024 14:54
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 18, 2024
@dosubot dosubot bot added the A-meta Area: databend meta serive label Sep 18, 2024
/// Indicates whether garbage collection is currently in progress for this dropped database.
///
/// If it is in progress, the database should not be un-dropped, because the data may be incomplete.
pub gc_in_progress: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

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

It means all dbs in old version this flag is false?

Because these dbs are not in progress.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, Currently no db is in gc state, this new state will be set only when the gc is started. And current codebase does not use this state.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 18, 2024
@drmingdrmer drmingdrmer force-pushed the 142-fix-16433-0 branch 2 times, most recently from 50ece24 to 84d4f20 Compare September 19, 2024 02:05
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 19, 2024
@drmingdrmer drmingdrmer force-pushed the 142-fix-16433-0 branch 3 times, most recently from 256d203 to d02481b Compare September 19, 2024 11:33
If `gc_in_progress` is set, no un-drop can be done on this database.
Because the related data may already have been deleted.

This commit does not use this flag yet, and will be used in next commit.

- Part of databendlabs#16433
@drmingdrmer drmingdrmer merged commit 2b6431c into databendlabs:main Sep 19, 2024
71 of 72 checks passed
@drmingdrmer drmingdrmer deleted the 142-fix-16433-0 branch September 19, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: databend meta serive lgtm This PR has been approved by a maintainer pr-refactor this PR changes the code base without new features or bugfix size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants