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(mito): fix region drop task runs multiple times but never clean the dir #2504

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

evenyag
Copy link
Contributor

@evenyag evenyag commented Sep 26, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

This PR fixes the following issues while dropping a region

  • background later drop task never exits until it exceeds max retry times
  • the dropping region map keeps the region that references all SSTs thus we can't purge them. This PR reset the Version so the region releases the references to SSTs and purges them.

It also adds a test to check whether the region directory is removed as expected.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

closes #2501

@evenyag evenyag marked this pull request as ready for review September 26, 2023 13:29
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #2504 (fb263e6) into develop (e352fb4) will decrease coverage by 0.35%.
The diff coverage is 80.67%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2504      +/-   ##
===========================================
- Coverage    85.25%   84.91%   -0.35%     
===========================================
  Files          729      729              
  Lines       115862   115943      +81     
===========================================
- Hits         98780    98449     -331     
- Misses       17082    17494     +412     

Copy link
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

LGTM

@evenyag evenyag requested a review from WenyXu September 27, 2023 02:57
@fengjiachun fengjiachun added this pull request to the merge queue Sep 27, 2023
Merged via the queue into GreptimeTeam:develop with commit db6ceda Sep 27, 2023
30 checks passed
@evenyag evenyag deleted the fix/drop-table-break branch September 27, 2023 06:45
}

// TODO(ruihang): place the marker in a separate dir
/// Removes region dir if there is no parquet files, returns whether the directory is removed.
pub(crate) async fn remove_region_dir_once(
Copy link
Contributor

Choose a reason for hiding this comment

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

Adds #[must_use] would be better.

paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
…he dir (GreptimeTeam#2504)

fix: fix region drop task runs multiple times but never clean the directory
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.

The background task drop table multiple times
4 participants