-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Summary
The unified spec test withTransaction and no transaction options set (first test in spec/spec_tests/data/unified/valid-pass/poc-transactions-convenient-api.yml) is chronically flaky on sharded cluster variants across all recent patches.
Root cause
The server returns [272:MigrationConflict] during the insert inside the transaction — "Database transaction-tests has undergone a catalog change operation ... Transaction will be aborted." withTransaction retries on TransientTransactionError, which produces an extra abortTransaction command plus another insert + commitTransaction. The test's strict expectEvents asserts exactly one insert + one commitTransaction, so the retry produces Unified::Error::ResultMismatch.
Observed on patch 69e6112ce684d600071d4697 and repro patch 69e6266db25c020007148109 across these variants:
- fle sharded 7.0 ruby-4.0
- fle sharded rapid ruby-3.1 / 3.2 / 3.4
- fle-mongocryptd sharded 8.0 ruby-4.0
- mongo-recent sharded 8.0 ruby-3.4
- mongo-4.x sharded 4.4 ruby-2.7
Mitigation
Restrict the test to replica-set topology via per-test runOnRequirements in spec/spec_tests/data/unified/valid-pass/poc-transactions-convenient-api.yml. The test passes reliably on replica set.
Follow-up
Investigate whether the unified runner can tolerate transient-transaction-retry events in strict expectEvents matching (or file a spec issue), so the test can be re-enabled on sharded.