CBG-5790: Fix import waits that assume a single Sync Gateway node - #500
Open
torcolvin wants to merge 3 commits into
Open
CBG-5790: Fix import waits that assume a single Sync Gateway node#500torcolvin wants to merge 3 commits into
torcolvin wants to merge 3 commits into
Conversation
- wait_for_import_count polled one node's shared_bucket_import expvar. Each import is handled by exactly one node, so on a multi-SGW cluster the polled node's count stays zero while another node does the import., and the test times out on a working system. - The wait itself was redundant: wait_for_all_documents already gates on the docs being visible, which implies the import ran. - Two tests waited for an async import without polling it. test_remove_dcp_cacert_handling slept a fixed 3s, which fails whenever import is slower than that; test_jwt_simple hand-rolled a 30s loop over _all_docs. Both now use wait_for_documents, which polls the _doc_ids filtered _changes feed via retry_assert.
borrrden
requested changes
Aug 25, 2026
torcolvin
commented
Sep 1, 2026
torcolvin
left a comment
Collaborator
Author
There was a problem hiding this comment.
Addressed comments and merged upstream code that used helper functions for get_changes.
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-5790: Fix import waits that assume a single Sync Gateway node
Fix import waits that assume a single Sync Gateway node
wait_for_import_count polled one node's shared_bucket_import expvar. Each import is handled by exactly one node, so on a multi-SGW cluster the polled node's count stays zero while another node does the import., and the test times out on a working system.
The wait itself was redundant: wait_for_all_documents already gates on the docs being visible, which implies the import ran.
Two tests waited for an async import without polling it. test_remove_dcp_cacert_handling slept a fixed 3s, which fails whenever import is slower than that; test_jwt_simple hand-rolled a 30s loop over _all_docs. Both now use wait_for_documents, which polls the _doc_ids filtered _changes feed via retry_assert.
wait_for_documentsdoes not poll the_all_docsendpoint because_all_docsdoes not have a backing index. It wouldn't matter for any data sizes used in the integration tests. https://docs.couchbase.com/sync-gateway/3.3/product-notes/release-notes.html#disable-the-public-all-docs-endpoint