summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorGeorge Wangensteen <george.wangensteen@10gen.com>2019-07-01 16:34:38 -0400
committerGeorge Wangensteen <george.wangensteen@10gen.com>2019-07-03 12:22:46 -0400
commit5813046272efb614ac78beb68885f1cb0ec58425 (patch)
tree4813f88fc797c3c40e75a7133ff7cdb777ab344f /src/mongo
parent15b0735e734d851663e931c95ed6cc4dd35ee4e3 (diff)
downloadmongo-5813046272efb614ac78beb68885f1cb0ec58425.tar.gz
SERVER-31252 Update comments for pinCursor and checkOutCursor.
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/cursor_manager.h7
-rw-r--r--src/mongo/s/query/cluster_cursor_manager.h7
2 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/cursor_manager.h b/src/mongo/db/cursor_manager.h
index 13cd5e5184f..19510f0bd03 100644
--- a/src/mongo/db/cursor_manager.h
+++ b/src/mongo/db/cursor_manager.h
@@ -110,6 +110,13 @@ public:
* Returns ErrorCodes::CursorNotFound if the cursor does not exist or
* ErrorCodes::QueryPlanKilled if the cursor was killed in between uses.
*
+ * If 'checkSessionAuth' is 'kCheckSession' or left unspecified, this function also checks if
+ * the current session in the specified 'opCtx' has privilege to access the cursor specified by
+ * 'id.' In this case, this function returns a 'mongo::Status' with information regarding the
+ * nature of the inaccessability when the cursor is not accessible. If 'kNoCheckSession' is
+ * passed for 'checkSessionAuth,' this function does not check if the current session is
+ * authorized to access the cursor with the given id.
+ *
* Throws a AssertionException if the cursor is already pinned. Callers need not specially
* handle this error, as it should only happen if a misbehaving client attempts to
* simultaneously issue two operations against the same cursor id.
diff --git a/src/mongo/s/query/cluster_cursor_manager.h b/src/mongo/s/query/cluster_cursor_manager.h
index 3d0afe5db94..0fcf0a51532 100644
--- a/src/mongo/s/query/cluster_cursor_manager.h
+++ b/src/mongo/s/query/cluster_cursor_manager.h
@@ -381,6 +381,13 @@ public:
* cursor. This function should check whether the current client is also authorized to use this
* cursor, and if not, return an error status, which will cause checkOutCursor to fail.
*
+ * If 'checkSessionAuth' is 'kCheckSession' or left unspecified, this function also checks if
+ * the current session in the specified 'opCtx' has privilege to access the cursor specified by
+ * 'id.' In this case, this function returns a 'mongo::Status' with information regarding the
+ * nature of the inaccessability when the cursor is not accessible. If 'kNoCheckSession' is
+ * passed for 'checkSessionAuth,' this function does not check if the current session is
+ * authorized to access the cursor with the given id.
+ *
* This method updates the 'last active' time associated with the cursor to the current time.
*
* Does not block.