-
Type:
Engineering Test
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
-
Storage Execution 2026-06-08
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Overview
SERVER-126328 introduced enableWriteConflictForWrites() and enableWriteConflictForReads() on RecordStoreHarnessHelper as a storage-engine-agnostic replacement for
directly naming the WTWriteConflictException and WTWriteConflictExceptionForReads WiredTiger-specific fail points in unit tests. Three callers were not migrated because they
live in fixtures that do not extend RecordStoreHarnessHelper (CatalogTestFixture and ShardServerTestFixture).
Background
Directly naming WT-specific fail points in tests outside the WT harness creates a hidden coupling: those tests will silently stop injecting write conflicts if the storage engine
ever changes, and they can never be run against alternative engines. The new harness API removes that coupling for RecordStoreHarnessHelper-based tests; the callers below need
the same treatment.
Scope of Work
The following three call sites still reference WT-specific fail points directly:
- src/mongo/db/shard_role/shard_catalog/collection_test.cpp — two tests (SetIndexIsMultikeyRemovesUncommittedChangesOnRollback and
ForceSetIndexIsMultikeyRemovesUncommittedChangesOnRollback) use FailPointEnableBlock("WTWriteConflictException") - src/mongo/db/shard_role/shard_catalog/collection_cache_recoverer_test.cpp — one test uses FailPointEnableBlock("WTWriteConflictExceptionForReads")
Because these tests use CatalogTestFixture / ShardServerTestFixture rather than RecordStoreHarnessHelper, migrating them will require either:
- Exposing standalone utility functions (e.g., in a test-only header) that return the correct FailPointEnableBlock for the active storage engine without requiring a harness
instance, or - Providing a mixin or helper accessible from ServiceContext-based fixtures.
Acceptance Criteria
- No unit test in the shard_catalog directory references WTWriteConflictException or WTWriteConflictExceptionForReads by name.
- The write-conflict injection mechanism used in the migrated tests is storage-engine-agnostic.
- Existing test coverage is preserved — the three tests still exercise the same rollback/recovery behavior they did before.
- is related to
-
SERVER-126328 Have a storage engine-agnostic way to turn on write conflict fail points in unit tests
-
- Closed
-