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

[bugfix] fixes issues sharding series by storageref vs fingerprint in… #6882

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Aug 11, 2022

… stripeSeries

I noticed a concurrent map read/write panic coming from our stripeSeries code at

github.com/grafana/loki/pkg/storage/stores/tsdb.(*stripeSeries).getByID(0xc0f7f52a00, 0x2?)

Reading over the code, I realized we were using the same lock index during Append calls, which is incorrect. To fix this problem and make the code a bit easier to work with, I embedded RWLocks in both the seriesHashmap and the memSeriesMap. This way, we don't reuse the same locks for both purposes, as the seriesHashmaps are sharded by fingerprint whereas the memSeriesMaps are sharded by StorageRef.

ref #5428

… stripeSeries

Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
@owen-d owen-d requested a review from a team as a code owner August 11, 2022 19:52
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

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

LGTM

@sandeepsukhani sandeepsukhani merged commit 3cba86f into grafana:main Aug 12, 2022
lxwzy pushed a commit to lxwzy/loki that referenced this pull request Nov 7, 2022
… stripeSeries (grafana#6882)

Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
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.

None yet

3 participants