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

Removes race conditions between tablet refresh and minor compaction #3634

Merged
merged 3 commits into from
Jul 28, 2023

Conversation

keith-turner
Copy link
Contributor

This commit moved the tablet twoards using a TabletMetadata object as the source of the tablets files instead of tracking the files itself. The move twoards using TabletMetadata support the changes to fix the race conditions with tablet refresh. Committing a minor compaction to walogs and the metadata table is now mutually exclusive with refreshing a tablets metadata. Scans should always see a consistent view of the in memory maps a tablet has and the files it has after this change. Before this change a tablet scan could see the file produced by a minor compaction and the in memory map that was the source of that file. Scans should only see one or the other.

fixes #3625

This commit moved the tablet twoards using a TabletMetadata object as
the source of the tablets files instead of tracking the files itself.
The move twoards using TabletMetadata support the changes to fix the
race conditions with tablet refresh.  Committing a minor compaction to
walogs and the metadata table is now mutually exclusive with refreshing
a tablets metadata.  Scans should always see a consistent view of the in
memory maps a tablet has and the files it has after this change.  Before
this change a tablet scan could see the file produced by a minor
compaction and the in memory map that was the source of that file.
Scans should only see one or the other.

fixes apache#3625
Copy link
Contributor

@dlmarion dlmarion left a comment

Choose a reason for hiding this comment

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

Looks good, I like replacing TabletData with TabletMetadata.

@EdColeman
Copy link
Contributor

FYI - it looks like spot bugs flagged:

Medium: org.apache.accumulo.tserver.tablet.Tablet.refreshMetadata(Tablet$RefreshPurpose) does not release lock on all exception paths [org.apache.accumulo.tserver.tablet.Tablet] At Tablet.java:[line 1418] UL_UNRELEASED_LOCK_EXCEPTION_PATH

@keith-turner keith-turner merged commit 7cf496a into apache:elasticity Jul 28, 2023
@keith-turner keith-turner deleted the accumulo-3625 branch July 28, 2023 16:56
@ctubbsii ctubbsii linked an issue Aug 2, 2023 that may be closed by this pull request
@ctubbsii ctubbsii added this to the 4.0.0 milestone Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Properly handle tablet metadata refresh
4 participants