diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2017-08-22 22:53:08 -0400 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2017-08-30 11:47:14 -0400 |
commit | bfbeb0cbabd9ae85f34df430474c9e524b274862 (patch) | |
tree | 4697dbc84e56120a5f34a1bd82182dc1e8740131 /src/mongo/s/query/store_possible_cursor.cpp | |
parent | 88ef24561ef69ac7756b80256a86515180b830a3 (diff) | |
download | mongo-bfbeb0cbabd9ae85f34df430474c9e524b274862.tar.gz |
SERVER-30799 Avoid misleading empty batches with tailable cursors.
This bug impacts tailable cursors being sent through a mongos.
Diffstat (limited to 'src/mongo/s/query/store_possible_cursor.cpp')
-rw-r--r-- | src/mongo/s/query/store_possible_cursor.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/s/query/store_possible_cursor.cpp b/src/mongo/s/query/store_possible_cursor.cpp index a2f912971d4..dce282c5892 100644 --- a/src/mongo/s/query/store_possible_cursor.cpp +++ b/src/mongo/s/query/store_possible_cursor.cpp @@ -70,6 +70,9 @@ StatusWith<BSONObj> storePossibleCursor(OperationContext* opCtx, auto ccc = ClusterClientCursorImpl::make(opCtx, executor, std::move(params)); + // We don't expect to use this cursor until a subsequent getMore, so detach from the current + // OperationContext until then. + ccc->detachFromOperationContext(); auto clusterCursorId = cursorManager->registerCursor(opCtx, ccc.releaseCursor(), |