Operational Defect Database

BugZero found this defect 2516 days ago.

MongoDB | 372082

[SERVER-28689] fix bug in drop_sharded_dbs.js where we assert.neq() on an entire array and its member

Last update date:

12/6/2017

Affected products:

MongoDB Server

Affected releases:

3.5.5

Fixed releases:

3.5.6

Description:

Info

Presumably the assert.neq() here should be on dbs[i], not just 'dbs'. https://github.com/mongodb/mongo/blob/73d3473f/jstests/sharding/drop_sharded_db.js#L42 // Drop the non-suffixed db and ensure that it is the only one that was dropped. dbA.dropDatabase(); var dbs = mongos.getDBNames(); for (var i = 0; i < dbs.length; i++) { assert.neq(dbs, "" + dbA); } Also, we should assert.commandWorked() on the dropDatabase(). Failing to assert.commandWorked() can lead to the test failing on a later line, as in BF-4953: https://github.com/mongodb/mongo/blob/73d3473f/jstests/sharding/drop_sharded_db.js#L45 assert.eq(0, config.databases.count({_id: dbA.getName()})); It's particularly misleading because the for-loop with the 'dbs' bug fails to catch when the db was not actually deleted, so it seems like an issue with the count().

Top User Comments

xgen-internal-githook commented on Mon, 10 Apr 2017 13:40:51 +0000: Author: {u'username': u'EshaMaharishi', u'name': u'Esha Maharishi', u'email': u'esha.maharishi@mongodb.com'} Message: SERVER-28689 fix bug in drop_sharded_dbs.js where we assert.neq() on an entire array and its member Branch: master https://github.com/mongodb/mongo/commit/54f2f3b1bcbf950d440daf839962630869a1a082

Additional Resources / Links

Share:

BugZero Risk Score

Coming soon

Status

Closed

Have you been affected by this bug?

cost-cta-background

Do you know how much operational outages are costing you?

Understand the cost to your business and how BugZero can help you reduce those costs.

Discussion

Login to read and write comments.

Have you ever...

had your data corrupted from a

VMware

bug?

Search:

...