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

Fix races in IAM cache lazy loading #19346

Merged
merged 1 commit into from Mar 26, 2024

Conversation

klauspost
Copy link
Contributor

@klauspost klauspost commented Mar 26, 2024

Description

Fixes #19344

On the top level we only grab a read lock, but we write to the cache if we manage to fetch it.

if ok {
is also flipped to what it should be AFAICT.

Change the internal cache structure to a concurrency safe implementation.

Bonus: Also switch grid map implementation. This appears ~10% faster for roundtrips.

I have NOT changed any of the existing locking. While it is very likely that they can be relaxed in some cases I cannot tell where it will be safe, so I will leave that to someone with deeper knowledge of this.

How to test this PR?

Set up IAM and hammer it.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

Fixes minio#19344

On the top level we only grab a read lock, but we write to the cache if we manage to fetch it.

https://github.com/minio/minio/blob/a03dac41ebd2c1b9d3f1110ef5d299ffebb8f87b/cmd/iam-store.go#L446 is also flipped to what it should be AFAICT.

Change the internal cache structure to a concurrency safe implementation.

Bonus: Also switch grid implementation.
@harshavardhana harshavardhana merged commit 7ff4164 into minio:master Mar 26, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fatal error: concurrent map writes with RELEASE.2024-03-21T23-13-43Z
2 participants