[SERVER-21750] getMore command does not set "nreturned" operation counter Created: 02/Dec/15  Updated: 16/Nov/16  Resolved: 11/Dec/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.2.1, 3.3.0

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: David Storch
Resolution: Done Votes: 0
Labels: code-and-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-6799 Changes to profiler entries / logs fo... Closed
Related
related to RUBY-1147 Error when sending getMore command on... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: QuInt D (12/14/15)
Participants:

 Description   

The "nreturned" field is never displayed in the diagnostic log line generated by the getMore command. "nreturned" is properly shown for legacy OP_GET_MORE requests.

Reproduce with the following script:

> db.foo.drop()
true
> db.foo.insert([{},{},{},{},{}])
BulkWriteResult({
	"writeErrors" : [ ],
	"writeConcernErrors" : [ ],
	"nInserted" : 5,
	"nUpserted" : 0,
	"nMatched" : 0,
	"nModified" : 0,
	"nRemoved" : 0,
	"upserted" : [ ]
})
> db.getMongo().forceReadMode('commands')
> db.foo.find().batchSize(3).itcount()
5
> db.getMongo().forceReadMode('legacy')
> db.foo.find().batchSize(3).itcount()
5

Output from the server when "commands" read mode is forced ("nreturned" not present for getMore):

2015-12-02T17:48:07.148-0500 I COMMAND  [conn1] command test.foo command: find { find: "foo", filter: {}, batchSize: 3.0 } planSummary: COLLSCAN cursorid:30116070077 keysExamined:0 docsExamined:3 keyUpdates:0 writeConflicts:0 numYields:0 nreturned:3 reslen:174 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_command 0ms
2015-12-02T17:48:07.149-0500 I COMMAND  [conn1] command test.foo command: getMore { getMore: 30116070077, collection: "foo", batchSize: 3.0 } ntoreturn:1 ntoskip:0 cursorExhausted:1 keyUpdates:0 writeConflicts:0 numYields:0 reslen:130 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_command 0ms

Output from the server when "legacy" read mode is forced ("nreturned" present for getMore):

2015-12-02T17:48:13.083-0500 I QUERY    [conn1] query test.foo planSummary: COLLSCAN cursorid:33369655876 ntoreturn:3 ntoskip:0 keysExamined:0 docsExamined:3 keyUpdates:0 writeConflicts:0 numYields:0 nreturned:3 reslen:86 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } 0ms
2015-12-02T17:48:13.084-0500 I QUERY    [conn1] getmore test.foo cursorid:33369655876 ntoreturn:3 cursorExhausted:1 keyUpdates:0 writeConflicts:0 numYields:0 nreturned:2 reslen:64 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } 0ms



 Comments   
Comment by Githook User [ 11/Dec/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-21750 clean up getMore logging and profiling

--Omit ntoreturn and ntoskip from the getMore command log line.
--Add nreturned to the getMore command log line.
--Upconvert OP_GET_MORE profiler entries to match getMore cmd.

(cherry picked from commit bb7e1e539da115da4ee1146c79e47c23109dce95)
Branch: v3.2
https://github.com/mongodb/mongo/commit/6670ca3ffaf09f79eff8e4e9f618cd1a13481398

Comment by Githook User [ 11/Dec/15 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-21750 clean up getMore logging and profiling

--Omit ntoreturn and ntoskip from the getMore command log line.
--Add nreturned to the getMore command log line.
--Upconvert OP_GET_MORE profiler entries to match getMore cmd.
Branch: master
https://github.com/mongodb/mongo/commit/bb7e1e539da115da4ee1146c79e47c23109dce95

Comment by David Storch [ 04/Dec/15 ]

We should also consider including keysExamined and docsExamined in the getMore command log lines (and maybe planSummary). We may also want to suppress ntoreturn and ntoskip, as we did for the find command log lines.

Generated at Thu Feb 08 03:58:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.