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

Compact: Make GatherNoCompactionMarkFilter.NoCompactMarkedBlocks concurrency safe #5736

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

igorwwwwwwwwwwwwwwwwwwww
Copy link
Contributor

This fixes a crash due to concurrent access.

concurrent map read and map write

fixes #5735

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

  • Adds locking to GatherNoCompactionMarkFilter.NoCompactMarkedBlocks

Verification

Let's see what CI says first.

…urrency safe

This fixes a crash due to concurrent access.

    concurrent map read and map write

fixes thanos-io#5735

Signed-off-by: Igor Wiedler <iwiedler@gitlab.com>
Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@fpetkovski fpetkovski left a comment

Choose a reason for hiding this comment

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

Not too familiar with the compactor, but this looks safe to me. Thanks.

Copy link
Collaborator

@matej-g matej-g 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 to me as well, thank you!

@matej-g matej-g merged commit e414597 into thanos-io:main Sep 28, 2022
@@ -1361,6 +1361,7 @@ type GatherNoCompactionMarkFilter struct {
bkt objstore.InstrumentedBucketReader
noCompactMarkedMap map[ulid.ULID]*metadata.NoCompactMark
concurrency int
mtx sync.Mutex
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it better using rw mutex?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compact: crash when running at high concurrency
5 participants