[SERVER-27487] sh.status() failed with err "collection or index disappeared when cursor yielded" Created: 21/Dec/16  Updated: 27/Oct/23  Resolved: 03/Jan/17

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

Type: Bug Priority: Major - P3
Reporter: Brian Samek Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding
Operating System: ALL
Participants:

 Description   

sh.status() failed with the following error message. Subsequent calls to sh.status() succeeded.

mongos> sh.status()
assert: command failed: {
        "ok" : 0,
        "errmsg" : "collection or index disappeared when cursor yielded: CappedPositionLost: CollectionScan died due to position in capped collection being deleted. Last seen record id: RecordId(2503660)",
        "code" : 16028,
        "codeName" : "Location16028"
} : aggregate failed
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:16:14
assert.commandWorked@src/mongo/shell/assert.js:370:5
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1319:5
sh.getRecentMigrations@src/mongo/shell/utils_sh.js:580:18
printShardingStatus@src/mongo/shell/utils_sh.js:761:26
sh.status@src/mongo/shell/utils_sh.js:89:5
@(shell):1:1
 
2016-12-21T13:14:02.179+0000 E QUERY    [main] Error: command failed: {
        "ok" : 0,
        "errmsg" : "collection or index disappeared when cursor yielded: CappedPositionLost: CollectionScan died due to position in capped collection being deleted. Last seen record id: RecordId(2503660)",
        "code" : 16028,
        "codeName" : "Location16028"
} : aggregate failed :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:16:14
assert.commandWorked@src/mongo/shell/assert.js:370:5
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1319:5
sh.getRecentMigrations@src/mongo/shell/utils_sh.js:580:18
printShardingStatus@src/mongo/shell/utils_sh.js:761:26
sh.status@src/mongo/shell/utils_sh.js:89:5
@(shell):1:1



 Comments   
Comment by Brian Samek [ 21/Dec/16 ]

I talked with kaloian.manassiev about this a bit. He suspects that what happened is that we were scanning the changelog collection and got a record that was deleted by the capped deleter. https://github.com/mongodb/mongo/blob/r3.4.0/src/mongo/shell/utils_sh.js#L580.

We just added several shards, so we've been doing chunk migrations. There have been about 4800 in the last 24 hours.

Both the shell and the server are running 3.4.0-rc4.

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