Skip to content

Conversation

@kevinAlbs
Copy link
Collaborator

Summary

Implement test changes described in DRIVERS-2816 to fix test failures:

Modify the unified test runner to collect the cluster time from the internal MongoClient following initialData operations, and use it to advance cluster times of all session entities created during the subsequent test

This change appears to fix ongoing failures for the client bulkWrite in a transaction test (example):

test file: client bulkWrite transactions
[...]
running test: client bulkWrite in a transaction
[...]
 error: expected result, but got error: Transaction 39dbb2a4-d1db-4913-bdbe-dec0b3056a91 - Il1bctjvfYRA0JpLUY4Xle2E6bw+KM1YpMr4x52qGgE= -  - :1 was aborted on statement 0 due to: a non-retryable snapshot error :: caused by :: Encountered error from localhost:27217 during a transaction :: caused by :: Database transaction-tests has undergone a catalog change operation at time Timestamp(1746646537, 68) and no longer satisfies the requirements for the current transaction which requires Timestamp(1746646537,

Tested with this patch build: https://spruce.mongodb.com/version/681cc957c6aad7000796aac0

Motivation

Quoting DRIVERS-2816:

SERVER-82353 addressed a correctness issue for sharded clusters, which requires gossipping the cluster time between mongos hsots (particularly the server used to create collections and other(s) used to execute transactions) in order to avoid a MigrationConflict error.

@kevinAlbs kevinAlbs changed the title CDRIVER-5304 Gossip cluster time from internal MongoClient to session entities CDRIVER-5304 set cluster time in test sessions May 8, 2025
@kevinAlbs kevinAlbs marked this pull request as ready for review May 8, 2025 17:16
@kevinAlbs kevinAlbs requested a review from a team as a code owner May 8, 2025 17:16
@kevinAlbs kevinAlbs requested a review from mdb-ad May 8, 2025 17:16
@kevinAlbs kevinAlbs merged commit 27c0581 into mongodb:master May 9, 2025
40 of 42 checks passed
eramongodb pushed a commit to eramongodb/mongo-c-driver that referenced this pull request Jul 31, 2025
* capture cluster time after initial data operations
* advance cluster time in newly created session entities
* handle tests that do not specify initial data
* do not try to read cluster time from standalone
eramongodb added a commit that referenced this pull request Jul 31, 2025
* CDRIVER-5891 address implicit bool-to-null conversion in return statements (#1888)
* CDRIVER-5891 extend C standard coverage up to C23 (#1890)
* CDRIVER-5959 sync change streams unified spec tests with 0aee4aad  (#1971)
* CDRIVER-5304 set cluster time in test sessions (#2008)
* Ignore -Wpre-c11-compat warnings when building public-header-warnings (#2027)
* CDRIVER-6042 Migrate Python scripts from Poetry to Astral UV (#2039)
* Migrate EVG task coverage to latest Debian, Ubuntu, and RHEL distros (#2044)
* CDRIVER-6010 use `ec2.assume_role` for Azure KMS task (#2051)
* CDRIVER-5971 Use Amazon ECR to obtain OCI images in EVG (#2058)
* update Earthly version from 0.8.3 to 0.8.16 (#2072)

---------

Co-authored-by: Kevin Albertson <[email protected]>
eramongodb pushed a commit to eramongodb/mongo-c-driver that referenced this pull request Jul 31, 2025
* capture cluster time after initial data operations
* advance cluster time in newly created session entities
* handle tests that do not specify initial data
* do not try to read cluster time from standalone
eramongodb added a commit that referenced this pull request Jul 31, 2025
* CDRIVER-5959 temporarily restrict updateDescription tests to 8.1 or older (#1970)
* CDRIVER-5959 sync change streams unified spec tests with 0aee4aad  (#1971)
* CDRIVER-5304 set cluster time in test sessions (#2008)
* CDRIVER-6010 use `ec2.assume_role` for mongohouse task (#2025)
* Ignore -Wpre-c11-compat warnings when building public-header-warnings (#2027)
* CDRIVER-6042 Migrate Python scripts from Poetry to Astral UV (#2039)
* Migrate EVG task coverage to latest Debian, Ubuntu, and RHEL distros (#2044)
* CDRIVER-6010 use `ec2.assume_role` for Azure KMS task (#2051)
* CDRIVER-5971 Use Amazon ECR to obtain OCI images in EVG (#2058)
* CDRIVER-5874 Drop Debian 10 EVG task coverage (#2062)
* update Earthly version from 0.8.3 to 0.8.16 (#2072)

---------

Co-authored-by: Kevin Albertson <[email protected]>
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.

2 participants