-
Notifications
You must be signed in to change notification settings - Fork 0
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
Move index values cache to bucket level to prevent race condition #306
Conversation
Signed-off-by: yeya24 <[email protected]>
The benchmark results are below and I did it twice. Comparing this pr with thanos-io#3705. The performance is similar overall, only a little bit improvement.
Ideally, this can be improved more by using more fine-grained locks, but I haven't benchmarked it. |
// Only update the cache if the block cache entry is not set. | ||
if v != zeroIndexSymbol && r.block.valueSymbols[k] == zeroIndexSymbol { | ||
r.block.valueSymbols[k] = v | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a problem. Not sure which way is better. Overwrite the entry every time?
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Signed-off-by: yeya24 [email protected]
The
indexHeader
is shared so we need to use locks. However, the upper levelbucketIndexReader
is one-per request so we don't need to add locks there. The idea is to move the values cache to the bucket level.Changes
Verification