[SERVER-27996] Accessing system.namespaces cursor with pending data after removing namespaces may cause crash Created: 13/Feb/17  Updated: 05/Apr/17  Resolved: 15/Feb/17

Status: Closed
Project: Core Server
Component/s: MMAPv1
Affects Version/s: None
Fix Version/s: 3.0.15, 3.2.13, 3.4.3, 3.5.4

Type: Bug Priority: Major - P3
Reporter: Maria van Keulen Assignee: Maria van Keulen
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-27199 audit places where we call deleteReco... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4, v3.2, v3.0
Steps To Reproduce:

use system_namespaces_invalidations;
let dbName = 'system_namespaces_invalidations';
let num_collections = 3;
for (let i = 0; i < num_collections; i++) {
    assert.commandWorked(db.createCollection('coll' + i.toString()));
}
let cmd = db.system.namespaces.count() ? {find: 'system.namespaces'} : {listCollections: dbName};
Object.extend(cmd, {batchSize: 2});
let res = db.runCommand(cmd);
assert.commandWorked(res, 'could not run ' + tojson(cmd));
let cursor = new DBCommandCursor(db.getMongo(), res);
let errMsg = 'expected more data from command ' + tojson(cmd) + ', with result ' + tojson(res);
assert(cursor.hasNext(), errMsg);
for (let j = 0; j < num_collections; j++) {
    assert(db['coll' + j.toString()].drop());
}
assert.gt(cursor.itcount(), 0, errMsg);

Participants:

 Description   

Another instance of SERVER-27199, we do not invalidate the namespace record ID upon removing a namespace. Executing the steps to reproduce thus may cause a crash.



 Comments   
Comment by Githook User [ 31/Mar/17 ]

Author:

{u'username': u'mvankeulen94', u'name': u'Maria van Keulen', u'email': u'maria@mongodb.com'}

Message: SERVER-27996 Invalidate stale system.namespaces record IDs

(cherry picked from commit c8afd7bba3aec74e49ce3467cce386f1d3f9b92f)
Branch: v3.0
https://github.com/mongodb/mongo/commit/3f3ff0050caf0b008b1b665348e4183c1d180f66

Comment by Githook User [ 10/Mar/17 ]

Author:

{u'username': u'mvankeulen94', u'name': u'Maria van Keulen', u'email': u'maria@mongodb.com'}

Message: SERVER-27996 Invalidate stale system.namespaces record IDs

(cherry picked from commit 9e0bacc738f93308bf7ab020f8959619e1f98519)
Branch: v3.2
https://github.com/mongodb/mongo/commit/c8afd7bba3aec74e49ce3467cce386f1d3f9b92f

Comment by Githook User [ 06/Mar/17 ]

Author:

{u'username': u'mvankeulen94', u'name': u'Maria van Keulen', u'email': u'maria@mongodb.com'}

Message: SERVER-27996 Invalidate stale system.namespaces record IDs

(cherry picked from commit 9e0bacc738f93308bf7ab020f8959619e1f98519)
Branch: v3.4
https://github.com/mongodb/mongo/commit/d369adefb61165340aff1c2ec8e3ed16c7f4c7de

Comment by Githook User [ 14/Feb/17 ]

Author:

{u'username': u'mvankeulen94', u'name': u'Maria van Keulen', u'email': u'maria@mongodb.com'}

Message: SERVER-27996 Invalidate stale system.namespaces record IDs
Branch: master
https://github.com/mongodb/mongo/commit/9e0bacc738f93308bf7ab020f8959619e1f98519

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