When an index build is aborted, it removes the temporary record stores for the hybrid index build.
If the storage transaction for removing the temporary record store is interrupted, the TemporaryKVRecordStore should reset its internal "finalized" flag in a rollback handler. However, the internal flag may not get reset if we get a WriteConflictException while trying to committing a WriteUnitOfWork in the ephemeralForTest storage engine (this is not possible with the default WiredTiger storage engine).
On a subsequent attempt to finalize the temporary record store, the server will fail this invariant.
- is related to
SERVER-50293 TemporaryKVRecordStore should reset the _recordStoreHasBeenFinalized flags state on a WriteConflictException
- related to
SERVER-58357 [ephemeralForTest] TemporaryKVRecordStore fails to register commit handler in WCE loop