If we call createIndexOnEmptyCollection() and roll back by not committing the WriteUnitOfWork that it was called in, then the second time we try to call this function, we hit an invariant:
Invariant failure findRecord(opCtx, loc, &data) Didn't find RecordId RecordId(2) in record store _mdb_catalog
The following pseudocode can be used to reproduce this:
{ WriteUnitOfWork wuow(); collection->getIndexCatalog()->createIndexOnEmptyCollection(); // WriteUnitOfWork is rolled back after leaving this scope. } WriteUnitOfWork wuow(); collection->getIndexCatalog()->createIndexOnEmptyCollection(); // above invariant hit. wuow.commit(); // unreachable
- related to
-
SERVER-38797 Add unit tests for the IndexCatalog
- Closed