summaryrefslogtreecommitdiff
path: root/src/mongo/client
diff options
context:
space:
mode:
authorCheahuychou Mao <cheahuychou.mao@mongodb.com>2020-02-24 22:48:22 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-28 19:54:40 +0000
commit0219d8e3489f7934c3eda10a18ac70de81d1e7b4 (patch)
tree9b29a85adfdf1470b84f72e8fdd2f03ca667403d /src/mongo/client
parentbd05da2372a83bdbe2efa1f488a893a9ea40530c (diff)
downloadmongo-0219d8e3489f7934c3eda10a18ac70de81d1e7b4.tar.gz
SERVER-9391 tailable cursors should throw an exception in DBClientCursor when a cursor is not found on the server
Diffstat (limited to 'src/mongo/client')
-rw-r--r--src/mongo/client/dbclient_cursor.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/client/dbclient_cursor.cpp b/src/mongo/client/dbclient_cursor.cpp
index 7af7d314769..77d5c802eb7 100644
--- a/src/mongo/client/dbclient_cursor.cpp
+++ b/src/mongo/client/dbclient_cursor.cpp
@@ -359,13 +359,11 @@ void DBClientCursor::dataReceived(const Message& reply, bool& retry, string& hos
// cursor id no longer valid at the server.
invariant(qr.getCursorId() == 0);
- if (!(opts & QueryOption_CursorTailable)) {
- uasserted(ErrorCodes::CursorNotFound,
- str::stream() << "cursor id " << cursorId << " didn't exist on server.");
- }
-
- // 0 indicates no longer valid (dead)
+ // 0 indicates no longer valid (dead).
cursorId = 0;
+
+ uasserted(ErrorCodes::CursorNotFound,
+ str::stream() << "cursor id " << cursorId << " didn't exist on server.");
}
if (cursorId == 0 || !(opts & QueryOption_CursorTailable)) {