Skip to content

CBG-5539 make sure to untrack deleted buckets#8435

Merged
bbrks merged 4 commits into
mainfrom
CBG-5539
Jul 13, 2026
Merged

CBG-5539 make sure to untrack deleted buckets#8435
bbrks merged 4 commits into
mainfrom
CBG-5539

Conversation

@torcolvin

Copy link
Copy Markdown
Collaborator

CBG-5539 make sure to untrack deleted buckets

Create a database and delete the database out from underneath. Without this fix, cluster compat manager will be consistently polling this unreachable bucket.

I will have an upcoming PR that actually has an integration test to delete a bucket in an integration test using code #8371 but this test code won't work until this and some other issues are fixed.

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Integration Tests

Create a database and delete the database out from underneath. Without this fix, cluster compat manager will be
consistently polling this unreachable bucket.
Copilot AI review requested due to automatic review settings July 8, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents the cluster compatibility manager from repeatedly polling bucket registries for buckets that have been deleted externally, by detecting “bucket no longer exists” conditions and untracking those buckets.

Changes:

  • Add a bucket-existence check during registry fetch failures and wrap confirmed “bucket deleted” cases in a sentinel error (errBucketDoesNotExist) for errors.Is handling.
  • Update cluster compat refresh logic to untrack buckets when that sentinel error is encountered.
  • Add a regression test covering refresh behavior with a tracked bucket that does not exist (with special handling for Rosmar auto-create behavior).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
rest/config_manager.go Adds bucketExists helper + sentinel error wrapping so callers can distinguish deleted buckets from transient I/O failures.
rest/cluster_compat.go Untracks buckets when registration fails due to confirmed bucket deletion.
rest/cluster_compat_test.go Adds test coverage for refresh behavior when a tracked bucket vanishes (and Rosmar-specific cleanup).

Comment thread rest/cluster_compat_test.go Outdated
Comment thread rest/cluster_compat_test.go Outdated
Comment thread rest/cluster_compat.go Outdated
Comment thread rest/cluster_compat.go
Comment on lines +492 to +495
if errors.Is(err, errBucketDoesNotExist) {
base.InfofCtx(ctx, base.KeyConfig, "Bucket %s no longer exists in cluster, removing from cluster compatibility manager %v", base.MD(bucket), err)
m.releaseBucket(bucket)
continue
torcolvin and others added 3 commits July 9, 2026 09:46
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bbrks bbrks merged commit 26c8cd0 into main Jul 13, 2026
69 of 70 checks passed
@bbrks bbrks deleted the CBG-5539 branch July 13, 2026 18:04
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.

3 participants