Skip to content

Sgw multi cbs test migration#323

Merged
vipbhardwaj merged 21 commits intomainfrom
sgw-multi_cbs-migration
Dec 16, 2025
Merged

Sgw multi cbs test migration#323
vipbhardwaj merged 21 commits intomainfrom
sgw-multi_cbs-migration

Conversation

@vipbhardwaj
Copy link
Contributor

The test being migrated is this

There are a lot of changes to the infra to support the multi-CBS topology, and I have changed the SGW topology.json to have 2 cbs' as well.

There are some changes to have both Private and Public IP to be served based on the need, since TDK requires to communicate via Public IP but some APIs use Private IP and the SGW <-> CBS comunication happens via private IP since they are a part of the same VPC in AWS up there. ☁️

I've also added a miniscule change of reducing the num_docs of test_purge fromm 1000 -> 100, to match the others, and after the continuous pain that it, unlike the other tests, takes more than half an hour due to 10x the docs to jiggle with.

Copy link
Member

@borrrden borrrden left a comment

Choose a reason for hiding this comment

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

In addition the sync gateway class I think needs some more thinking (messaged offline)

@vipbhardwaj vipbhardwaj requested a review from borrrden November 26, 2025 06:17
@vipbhardwaj
Copy link
Contributor Author

I've addressed the issues in the sub-comments, as to the SGW related parent comment issue, I am working on it and will merge the appropriate code in the PR#322 : sgw-refactoring
As that is the one catering to the SGW based class changes.
Re requesting review : @borrrden , @RIT3shSapata

Copy link
Member

@borrrden borrrden left a comment

Choose a reason for hiding this comment

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

Let's start with this. Also this PR has a bunch of sync gateway changes. If they are needed lets focus on the other PR first which is for those changes.

@vipbhardwaj vipbhardwaj force-pushed the sgw-multi_cbs-migration branch from 85a3d74 to efb6d5b Compare December 1, 2025 07:06
@vipbhardwaj vipbhardwaj requested a review from borrrden December 1, 2025 07:20
@vipbhardwaj vipbhardwaj requested a review from borrrden December 4, 2025 09:48
@vipbhardwaj
Copy link
Contributor Author

I resolved the merge conflicts since the #306 got merged and now I think this PR is ripe to be merged too 🍓 ✅

@vipbhardwaj vipbhardwaj requested a review from borrrden December 8, 2025 04:36
@vipbhardwaj
Copy link
Contributor Author

@borrrden @RIT3shSapata I've added another test to the same file hence requesting reviews again.

TDK changes :

  1. Changed the configure-nodes script to have it add the kv, n1ql ports too since they SDK ops were targeting out
  2. As to why now? Why not before?
  3. I've changed the topology to have 3 CB-clusters and hence 3 SG-nodes serving the 3 CBs each.
  4. To keep the change backwards compatible, I've added servers in this way :
  5. CBS initially only needed 2 nodes in a single cluster, so now I've added more 2 servers, each being a cluster in its own, hence there are 3 CBS CLUSTERS now, CLUSTER 1 = 2 node, CLUSTER 2 and 3 = 1 node each
  6. For these 3 clusters to be served by SGWs, we only need 1 SG server per cluster. Hence I added two more SG servers too, so total of 5 SG nodes where 3 serve CLUSTER 1, and then the 4th and 5th serve CLUSTER 2 and 3 resp.

TEST changes :

Added a test for collection based mapping across clusters.
This is the test that's been migrated. Basically 3 docs added per SG targeted to specific collections in each CLUSTER's buckets.
Then ISGR is done, once push, once pull, and then it's verified that the docs got replicated correctly.

Copy link

@RIT3shSapata RIT3shSapata left a comment

Choose a reason for hiding this comment

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

The tests look good, I just have a few nits about the description of the tests and code cleanliness

@vipbhardwaj
Copy link
Contributor Author

Guys please give a final review for this please 😢

@vipbhardwaj vipbhardwaj merged commit 94cf14e into main Dec 16, 2025
4 checks passed
@vipbhardwaj vipbhardwaj deleted the sgw-multi_cbs-migration branch December 16, 2025 04:44
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