[SERVER-25286] Remove drop2.js dependency on count scan yield behavior Created: 26/Jul/16  Updated: 05/Apr/17  Resolved: 15/Dec/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.2.12, 3.4.2, 3.5.2

Type: Bug Priority: Major - P3
Reporter: David Hatch Assignee: Kyle Suarez
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File repo.patch    
Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4, v3.2
Sprint: Query 2017-01-23
Participants:
Linked BF Score: 0

 Description   

The drop2.js test command can fail in particular atypical timing of the parallel shells.

drop2.js uses a count command with a infinite $where clause in order to block a drop operation so that we may check whether killOp can be used on the drop collection command. We believe this test is attempting to confirm that we are able to issue a killOp on a drop collection command, but that the operation is not interrupted, which prior to SERVER-1818 could leave the database in an inconsistent state.

On a correct execution, the count command acquires a read lock on the collection, preventing it from being dropped. However, if the count command yields, it releases the collection lock. This allowed the collection to drop before we can observe it in the currentOp output in drop2.js.

max.hirschhorn suggests that we rewrite this test in order to:

1. Issue a fsyncLock command.
2. Execute a drop collection, wait until the currentOp output indicates it is waiting for locks.
3. Issue a killOp for the drop operation.
4. Issue fsyncUnlock.
5. Check that the drop operation was not killed, and that the collection was dropped successfully.

This removes the dependency on the yielding behavior of the count command. We have inspected the code path and confirmed that the only call to checkForInterrupt() during the execution of a drop command is here, before the drop command attempts to acquire locks here.



 Comments   
Comment by Githook User [ 20/Jan/17 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}

Message: SERVER-25286 rewrite drop2.js to not depend on count scan yield behavior

Tweaks killop_drop_collection.js to not use ES6 features and the new response format of fsyncUnlock.

(cherry picked from commit 703678d473121b6402df10c21060241096ee2722)

Conflicts:
buildscripts/resmokeconfig/suites/sharded_collections_jscore_passthrough.yml
buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml
Branch: v3.2
https://github.com/mongodb/mongo/commit/d4e459b768349936ce72bb53ec056bc5918119f1

Comment by Githook User [ 18/Jan/17 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'redbeard0531@gmail.com'}

Message: Revert "SERVER-25286 rewrite drop2.js to not depend on count scan yield behavior"

This reverts commit 3c2c8f709d7043d22d1161fce807c40e4d624742.
Branch: v3.2
https://github.com/mongodb/mongo/commit/1b45a872f86bcb230c3e70e00bb05622d538a793

Comment by Githook User [ 18/Jan/17 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}

Message: SERVER-25286 rewrite drop2.js to not depend on count scan yield behavior

(cherry picked from commit 703678d473121b6402df10c21060241096ee2722)

Conflicts:
buildscripts/resmokeconfig/suites/sharded_collections_jscore_passthrough.yml
buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml
Branch: v3.2
https://github.com/mongodb/mongo/commit/3c2c8f709d7043d22d1161fce807c40e4d624742

Comment by Githook User [ 18/Jan/17 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}

Message: SERVER-25286 rewrite drop2.js to not depend on count scan yield behavior

(cherry picked from commit 703678d473121b6402df10c21060241096ee2722)

Conflicts:
buildscripts/resmokeconfig/suites/sharded_collections_jscore_passthrough.yml
buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml
Branch: v3.4
https://github.com/mongodb/mongo/commit/a10fb3c03e6770e94df1ffed7fc50457115aca78

Comment by Githook User [ 15/Dec/16 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}

Message: SERVER-25286 rewrite drop2.js to not depend on count scan yield behavior
Branch: master
https://github.com/mongodb/mongo/commit/703678d473121b6402df10c21060241096ee2722

Comment by David Hatch [ 26/Jul/16 ]

Attached is a patch that adds a repo.js script, and some failpoints to the server to reproduce the failure case.

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