summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/requires_collection_stage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/exec/requires_collection_stage.cpp')
-rw-r--r--src/mongo/db/exec/requires_collection_stage.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/db/exec/requires_collection_stage.cpp b/src/mongo/db/exec/requires_collection_stage.cpp
index 5825485dea6..c4794c3bfd2 100644
--- a/src/mongo/db/exec/requires_collection_stage.cpp
+++ b/src/mongo/db/exec/requires_collection_stage.cpp
@@ -50,9 +50,18 @@ void RequiresCollectionStageBase<CollectionT>::doRestoreState() {
const UUIDCatalog& catalog = UUIDCatalog::get(getOpCtx());
_collection = catalog.lookupCollectionByUUID(_collectionUUID);
uassert(ErrorCodes::QueryPlanKilled,
- str::stream() << "UUID " << _collectionUUID << " no longer exists.",
+ str::stream() << "Collection dropped. UUID " << _collectionUUID << " no longer exists.",
_collection);
+ // TODO SERVER-31695: Allow queries to survive collection rename, rather than throwing here when
+ // a rename has happened during yield.
+ uassert(ErrorCodes::QueryPlanKilled,
+ str::stream() << "Collection with UUID " << _collectionUUID << " was renamed from '"
+ << _nss.ns()
+ << "' to '"
+ << _collection->ns().ns(),
+ _nss == _collection->ns());
+
doRestoreStateRequiresCollection();
}