Skip to content

CBG-5499 Remove dead non-xattr code used for query#8402

Merged
bbrks merged 4 commits into
mainfrom
CBG-5499
Jul 6, 2026
Merged

CBG-5499 Remove dead non-xattr code used for query#8402
bbrks merged 4 commits into
mainfrom
CBG-5499

Conversation

@torcolvin

@torcolvin torcolvin commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

CBG-5499 Remove dead non-xattr code used for query

Sync Gateway only supports enable_shared_bucket_access / xattrs since 4.0. Remove dead code. I left the index definitions to drop in the index names to make it clear that they were not changing.

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

@torcolvin torcolvin self-assigned this Jul 1, 2026
Copilot AI review requested due to automatic review settings July 1, 2026 16:22

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 removes legacy non-xattr query/index code paths and associated test branching, aligning index/query generation with Sync Gateway 4.0+ where xattrs are required. It simplifies index naming/token replacement by eliminating the UseXattrs parameter plumbing and standardizing on _xN index variants while still testing cleanup of old _1 indexes during post-upgrade.

Changes:

  • Remove UseXattrs-based branching from index/query token replacement and index option plumbing.
  • Standardize tests to expect _x1 index names and always enable xattrs in relevant configs.
  • Update post-upgrade index cleanup tests to explicitly create old non-xattr (*_1) indexes and verify they’re removed.

Reviewed changes

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

Show a summary per file
File Description
rest/server_context.go Stop passing UseXattrs into legacy-index selection; rely on xattrs-only behavior.
rest/indextest/post_upgrade_test.go Remove non-xattr branches from REST post-upgrade index tests; keep expected removed index names stable.
rest/indextest/index_test.go Hardcode _x1 index expectations and remove non-xattr skips/branches in index tests.
rest/indextest/index_init_api_test.go Simplify index-init API tests to xattrs-only index suffix handling.
rest/database_init_manager.go Remove UseXattrs from constructed index initialization options.
db/util_testing.go Remove UseXattrs from test bucket/index initialization options.
db/query.go Remove non-xattr token replacement paths in N1QL query statement construction.
db/query_test.go Update query coverage test to use xattrs-only token/index replacement signatures.
db/indextest/util.go Remove xattr toggle from index test helper options; add helper to create legacy non-xattr index names.
db/indextest/post_upgrade_test.go Rewrite upgrade/removal tests to xattrs-only runtime while simulating old _1 indexes for cleanup verification.
db/indextest/indextest_test.go Remove non-xattr matrix cases and update index expectations to xattrs-only naming.
db/indextest/indextest_dual_metadata_test.go Remove UseXattrs from index initialization options in dual-metadata tests.
db/indexes.go Remove non-xattr sync token/index naming logic and UseXattrs from index options/signatures.
db/database.go Remove UseXattrs from in-use index computation options.
db/background_mgr_resync_dcp.go Remove UseXattrs from principal-index initialization options.

Comment thread db/indexes.go
Comment thread db/indexes.go Outdated
Comment thread db/indexes.go Outdated
torcolvin and others added 2 commits July 1, 2026 16:25
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@torcolvin torcolvin assigned bbrks and unassigned torcolvin Jul 2, 2026
@torcolvin torcolvin requested a review from bbrks July 2, 2026 13:58
@bbrks bbrks merged commit b806213 into main Jul 6, 2026
51 checks passed
@bbrks bbrks deleted the CBG-5499 branch July 6, 2026 12:49
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