diff options
author | Arun Banala <arun.banala@10gen.com> | 2019-09-24 16:50:09 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-24 16:50:09 +0000 |
commit | 60518c8920064b30df53129ea880dacfcb04be71 (patch) | |
tree | aa9054360e25e2b3505dbced16bfb5922e606bb9 /src/mongo/s/query | |
parent | 7edbbc86d4ac06fddd3ab3482d2985392811032b (diff) | |
download | mongo-60518c8920064b30df53129ea880dacfcb04be71.tar.gz |
SERVER-29794 Adding a comment to all commands
Diffstat (limited to 'src/mongo/s/query')
-rw-r--r-- | src/mongo/s/query/cluster_find.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp index e697d32f150..69fe465d4cb 100644 --- a/src/mongo/s/query/cluster_find.cpp +++ b/src/mongo/s/query/cluster_find.cpp @@ -371,6 +371,12 @@ Status setUpOperationContextStateForGetMore(OperationContext* opCtx, ReadPreferenceSetting::get(opCtx) = *readPref; } + // If the originating command had a 'comment' field, we extract it and set it on opCtx. Note + // that if the 'getMore' command itself has a 'comment' field, we give precedence to it. + auto comment = cursor->getOriginatingCommand()["comment"]; + if (!opCtx->getComment() && comment) { + opCtx->setComment(comment.wrap()); + } if (cursor->isTailableAndAwaitData()) { // For tailable + awaitData cursors, the request may have indicated a maximum amount of time // to wait for new data. If not, default it to 1 second. We track the deadline instead via |