Skip to content

Fix compactor to handle not-found error in Attributes when updating block index#7454

Merged
friedrichg merged 3 commits intocortexproject:masterfrom
alex-berger:master
Apr 30, 2026
Merged

Fix compactor to handle not-found error in Attributes when updating block index#7454
friedrichg merged 3 commits intocortexproject:masterfrom
alex-berger:master

Conversation

@alex-berger
Copy link
Copy Markdown
Contributor

What this PR does:

Handle not-found and access-denied errors from Attributes() in bucket index updater, preventing a stale cached Get() from causing the entire cleanup cycle to fail when meta.json has been deleted from object storage.

  • Return ErrBlockMetaNotFound if meta.json attributes are missing
  • Extend MockBucketFailure to support AttributesFailures for testing
  • Add test to verify updater skips blocks with missing meta attributes

Which issue(s) this PR fixes:
Fixes #7453

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

index.

Handle not-found and access-denied errors from `Attributes()` in bucket
index updater, preventing a stale cached `Get()` from causing the entire
cleanup cycle to fail when `meta.json` has been deleted from object
storage.

- Return ErrBlockMetaNotFound if meta.json attributes are missing
- Extend MockBucketFailure to support AttributesFailures for testing
- Add test to verify updater skips blocks with missing meta attributes

Fixes cortexproject#7453

Signed-off-by: alex.berger <alex-berger@gmx.ch>
Copy link
Copy Markdown
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

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

Thanks!

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 28, 2026
Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com>
Comment thread CHANGELOG.md Outdated
Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com>
@friedrichg friedrichg merged commit bd573c3 into cortexproject:master Apr 30, 2026
67 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/compactor lgtm This PR has been approved by a maintainer size/M type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compactor cleaner fatally fails when meta.json Attributes() returns not-found after cached Get() succeeds

3 participants