Conversation
Contributor
There was a problem hiding this comment.
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
_x1index 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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
bbrks
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
fmt.Print,log.Print, ...)base.UD(docID),base.MD(dbName))docs/apiIntegration Tests