summaryrefslogtreecommitdiff
path: root/src/mongo/db/cursor_manager.cpp
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2017-07-31 18:33:20 -0400
committerJason Carey <jcarey@argv.me>2017-08-22 12:08:57 -0400
commit5fa946faad4ec2817f6b83684811333270f45c78 (patch)
treeaff3a3345fc2d9594854f387a53755f65750a1a9 /src/mongo/db/cursor_manager.cpp
parent53a831fd5d462fbd5bc050d0b4eaf5875a41400b (diff)
downloadmongo-5fa946faad4ec2817f6b83684811333270f45c78.tar.gz
SERVER-28342 Ensure session bookkeeping happens
Ensure we properly vivify session records on ingress.
Diffstat (limited to 'src/mongo/db/cursor_manager.cpp')
-rw-r--r--src/mongo/db/cursor_manager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/cursor_manager.cpp b/src/mongo/db/cursor_manager.cpp
index d2013c14f0f..e7192105867 100644
--- a/src/mongo/db/cursor_manager.cpp
+++ b/src/mongo/db/cursor_manager.cpp
@@ -41,6 +41,7 @@
#include "mongo/db/client.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/kill_sessions_common.h"
+#include "mongo/db/logical_session_cache.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/query/plan_executor.h"
@@ -512,6 +513,13 @@ StatusWith<ClientCursorPin> CursorManager::pinCursor(OperationContext* opCtx, Cu
return error;
}
cursor->_isPinned = true;
+
+ // We use pinning of a cursor as a proxy for active, user-initiated use of a cursor. Therefor,
+ // we pass down to the logical session cache and vivify the record (updating last use).
+ if (cursor->getSessionId()) {
+ LogicalSessionCache::get(opCtx)->vivify(opCtx, cursor->getSessionId().get());
+ }
+
return ClientCursorPin(opCtx, cursor);
}