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

Store: Fix data race in advertised label set in bucket store #5204

Merged
merged 2 commits into from
Mar 2, 2022

Conversation

matej-g
Copy link
Collaborator

@matej-g matej-g commented Mar 2, 2022

Signed-off-by: Matej Gera [email protected]

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

Changes

As a part of #5066, we have detected some data races. One of them is occurring due to concurrent write / read of bucket store's label set, excerpt:

12:05:39 store-gw-1: ==================
12:05:39 store-gw-1: WARNING: DATA RACE
12:05:39 store-gw-1: Read at 0x00c0001c2450 by goroutine 36:
12:05:39 store-gw-1: github.com/thanos-io/thanos/pkg/store.(*BucketStore).LabelSet()
12:05:39 store-gw-1: /go/src/github.com/thanos-io/thanos/pkg/store/bucket.go:687 +0x3d
12:05:39 store-gw-1: main.runStore.func6()
12:05:39 store-gw-1: /go/src/github.com/thanos-io/thanos/cmd/thanos/store.go:393 +0x1d8
12:05:39 store-gw-1: github.com/thanos-io/thanos/pkg/info.(*InfoServer).Info()
...
12:05:39 store-gw-1: Previous write at 0x00c0001c2450 by goroutine 110:
12:05:39 store-gw-1: github.com/thanos-io/thanos/pkg/store.(*BucketStore).SyncBlocks()
12:05:39 store-gw-1: /go/src/github.com/thanos-io/thanos/pkg/store/bucket.go:511 +0xcc4
...

In addition, I simplified the Info server method defaults.

Verification

Ran tests locally with #5066; data race not being detected anymore.

Signed-off-by: Matej Gera <[email protected]>
Signed-off-by: Matej Gera <[email protected]>
@GiedriusS GiedriusS merged commit 34e6527 into thanos-io:main Mar 2, 2022
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.

2 participants