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:
parent
8cc87001a2
commit
ba18ad9536
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user