0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-48334 numIndexesTotal should only rethrow WriteConflictExceptions in a WriteUnitOfWork

This commit is contained in:
Louis Williams 2020-06-24 17:29:34 -04:00 committed by Evergreen Agent
parent 8cc87001a2
commit ba18ad9536

View File

@ -1123,7 +1123,7 @@ int IndexCatalogImpl::numIndexesTotal(OperationContext* opCtx) const {
dassert(DurableCatalog::get(opCtx)->getTotalIndexCount(
opCtx, _collection->getCatalogId()) == count);
} catch (const WriteConflictException& ex) {
if (opCtx->lockState()->isWriteLocked()) {
if (opCtx->lockState()->inAWriteUnitOfWork()) {
// Must abort this write transaction now.
throw;
}