diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2020-10-21 11:21:42 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-10-21 16:43:22 +0000 |
commit | 982c685651b1d76222ac84aadf6130a51add1411 (patch) | |
tree | 54b42a29362a26285cedb6a4a8a7672980d1d897 /src/mongo | |
parent | 4219b4d7be92d6f9a512bba9c0d8c91eb52f54e3 (diff) | |
download | mongo-982c685651b1d76222ac84aadf6130a51add1411.tar.gz |
SERVER-50999 Cleanup snapshot in AutoGetCollectionForReadLockFree if collection is dropped during loop
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/db_raii.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp index 31629ce6931..a63a9ea534b 100644 --- a/src/mongo/db/db_raii.cpp +++ b/src/mongo/db/db_raii.cpp @@ -300,12 +300,9 @@ AutoGetCollectionForReadLockFree::AutoGetCollectionForReadLockFree( opCtx, _autoGetCollectionForReadBase.get()->uuid()); // The collection may have been dropped since the previous lookup, run the loop one more - // time to cleanup - if (!newCollection) { - continue; - } - - if (_autoGetCollectionForReadBase.get()->getMinimumVisibleSnapshot() == + // time to cleanup if newCollection is nullptr + if (newCollection && + _autoGetCollectionForReadBase.get()->getMinimumVisibleSnapshot() == newCollection->getMinimumVisibleSnapshot() && replTerm == repl::ReplicationCoordinator::get(opCtx)->getTerm()) { break; |