[SERVER-24559] UnknownError can be returned on PlanExecutor::DEAD in find/getMore Created: 14/Jun/16  Updated: 30/Sep/22  Resolved: 08/Jul/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 3.0.8
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-24965 Change resync.js to expect UnknownErr... Closed
Operating System: ALL
Steps To Reproduce:

db.capped.drop();
assert.commandWorked(db.runCommand({create: "capped", capped: true, size: 4096}));
 
var smallPadding = new Array(500).join("x");
assert.writeOK(db.capped.insert({x: smallPadding}));
assert.writeOK(db.capped.insert({x: smallPadding}));
assert.writeOK(db.capped.insert({x: smallPadding}));
var cursor = db.capped.find().batchSize(2);
cursor.next();
cursor.next();
 
var largePadding = new Array(2000).join("y");
assert.writeOK(db.capped.insert({x: largePadding}));
assert.writeOK(db.capped.insert({x: largePadding}));
cursor.next();

Output

2016-06-14T11:12:37.810-0400 E QUERY    Error: error: {
  "$err" : "getMore executor error: UnknownError no details available",
  "code" : 17406
}
    at Error (<anonymous>)
    at DBQuery.next (src/mongo/shell/query.js:259:15)
    at (shell):1:8 at src/mongo/shell/query.js:259

Participants:
Case:
Linked BF Score: 0

 Description   

We backported part of the PlanExecutor::DEAD changes to the 3.0 branch in order to address SERVER-20973. However, the backport missed the changes to plan_executor.cpp to set objOut as the status member object.



 Comments   
Comment by Max Hirschhorn [ 08/Jul/16 ]

On the 3.0 branch, a user will end up seeing a "getMore executor error: UnknownError no details available" message when the cursor's position in a capped collection is truncated, instead of a more informative "CappedPositionLost: CollectionScan died due to position in capped collection being deleted" message. The PlanExecutor is still considered dead and an error is still returned, so there isn't a correctness issue here. Based on an internal discussion we've decided this issue isn't critical enough to address on the 3.0 branch, so I'm closing this ticket as "Won't fix".

Comment by Max Hirschhorn [ 14/Jun/16 ]

On the 3.2 and master branches, the user would see the CappedPositionLost error as expected.

2016-06-14T11:20:26.396-0400 E QUERY    [thread1] Error: getMore command failed: {
	"ok" : 0,
	"errmsg" : "GetMore command executor error: CappedPositionLost: CollectionScan died due to position in capped collection being deleted. Last seen record id: RecordId(2)",
	"code" : 96
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DBCommandCursor.prototype._runGetMoreCommand@src/mongo/shell/query.js:753:1
DBCommandCursor.prototype._hasNextUsingCommands@src/mongo/shell/query.js:781:9
DBCommandCursor.prototype.hasNext@src/mongo/shell/query.js:789:1
DBQuery.prototype.next@src/mongo/shell/query.js:289:13
@(shell):1:1

Generated at Thu Feb 08 04:06:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.