Skip to content

Fix regex resolver corrupting the users scanner cache - #7812

Open
SungJin1212 wants to merge 1 commit into
masterfrom
fix-regex-resolver-scanner-slice-mutation
Open

Fix regex resolver corrupting the users scanner cache#7812
SungJin1212 wants to merge 1 commit into
masterfrom
fix-regex-resolver-scanner-slice-mutation

Conversation

@SungJin1212

Copy link
Copy Markdown
Member

The regex resolver builds its user list with append(active, deleting...) followed by
an in-place sort.Strings. When -blocks-storage.users-scanner.cache-ttl is set, the
users scanner returns the very same slices on every scan, so sorting in place corrupts
the cached active list.

For example:

sync knownUsers
1 [a-del b-1 b-2 b-3]
2 [a-del a-del b-1 b-2]
3 [a-del a-del a-del b-1]
4 [a-del a-del a-del a-del]
...

Tenants silently disappear from federated query results until the scanner cache expires.

This PR fixes it by copying the scanner result into a newly allocated slice before
sorting, so the sort only touches memory the resolver owns.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@SungJin1212
SungJin1212 requested a review from a team as a code owner August 26, 2026 07:04
@SungJin1212
SungJin1212 requested a review from friedrichg August 26, 2026 07:04
@dosubot dosubot Bot added the type/bug label Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant