Skip to content

DRIVERS-3397: Add SDAM tests for constant setVersion#1895

Merged
jyemin merged 2 commits intomongodb:masterfrom
jyemin:DRIVERS-3397
Feb 26, 2026
Merged

DRIVERS-3397: Add SDAM tests for constant setVersion#1895
jyemin merged 2 commits intomongodb:masterfrom
jyemin:DRIVERS-3397

Conversation

@jyemin
Copy link
Contributor

@jyemin jyemin commented Feb 12, 2026

Add server discovery and monitoring tests for replica sets that use a constant setVersion value instead of incrementing it on reconfig.

This adds four test scenarios:

  • Primary changes with unchanged setVersion (electionId-based detection)
  • Migration from incrementing to constant setVersion
  • Migration from constant to incrementing setVersion
  • Secondaries are added and removed from the topology based on hello response from primary when electionId/setVersion remain constant

These tests validate that drivers correctly handle primary staleness detection when setVersion remains constant across topology changes.

Please complete the following before merging:

  • Is the relevant DRIVERS ticket in the PR title?
  • [] Update changelog. N/A I think as there is no spec change just some additional tests
  • Test changes in at least one language driver.
  • [] Test these changes against all server versions and topologies (including standalone, replica set, and sharded
    clusters). N/A as these are unit tests.

Add server discovery and monitoring tests for replica sets that use
a constant setVersion value instead of incrementing it on reconfig.

This adds three test scenarios:
- Primary changes with unchanged setVersion (electionId-based detection)
- Migration from incrementing to constant setVersion
- Migration from constant to incrementing setVersion

These tests validate that drivers correctly handle primary staleness
detection when setVersion remains constant across topology changes.
@jyemin jyemin self-assigned this Feb 12, 2026
Copy link

@XueruiFa XueruiFa left a comment

Choose a reason for hiding this comment

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

Thanks very much for adding these tests!

@@ -0,0 +1,118 @@
# Disaggregated storage clusters use a constant setVersion (typically 1) instead of

Choose a reason for hiding this comment

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

Would it be possible to also add a test that the member list is updated if setVersion and electionId remain the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New test added. Please have a look.

@jyemin jyemin marked this pull request as ready for review February 25, 2026 22:31
@jyemin jyemin requested a review from a team as a code owner February 25, 2026 22:31
@jyemin jyemin requested review from ShaneHarvey and removed request for a team February 25, 2026 22:31
Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

@ShaneHarvey
Copy link
Member

The tests pass in evergreen too. LGTM.

@jyemin jyemin merged commit 1bcb8ed into mongodb:master Feb 26, 2026
6 checks passed
@jyemin jyemin deleted the DRIVERS-3397 branch February 26, 2026 22:00
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