[SERVER-20187] drain mode must wait for synctail to unblock from blockingPeek call Created: 28/Aug/15  Updated: 25/Jan/17  Resolved: 03/Sep/15

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

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: RPL 9 (09/18/15)
Participants:

 Description   

The server does not exit drain mode until the timeout on the condvar waiting for more ops in the queue. This can delay stepping up to primary for up to one second.



 Comments   
Comment by Githook User [ 03/Sep/15 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-20187 wake up from blockingPeek when entering drain mode
Branch: master
https://github.com/mongodb/mongo/commit/20e7c1c9e1c138e37b8c3c3009bcdd9c69d92667

Comment by Githook User [ 03/Sep/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-20187 removed task executor argument from ReplicationCoordinatorExternalState::startThreads
Branch: master
https://github.com/mongodb/mongo/commit/84a461126d2286d34414bc01b5272791ee37de18

Comment by Githook User [ 03/Sep/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-20187 BackgroundSync::producerThread does not need external task executor
Branch: master
https://github.com/mongodb/mongo/commit/0ebf28b05cdea6c8b2599ec80594d63ac4a3f9be

Comment by Githook User [ 03/Sep/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-20187 BackgroundSync::cancelFetcher() aborts existing find/getMore commands using NetworkInterface::cancelAllCommands()
Branch: master
https://github.com/mongodb/mongo/commit/d7f02c9c1a6bb0271b1eaa571178c43ec2c57d34

Comment by Githook User [ 03/Sep/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-20187 added ReplicationCoordinatorExternalState::signalApplierToCancelFetcher()

This function notifies the BackgroundSync thread to cancel find/getMore commands that are
currently blocking on the sync source.
Branch: master
https://github.com/mongodb/mongo/commit/f64df733c36f2e1b3336e6f6ae2f8553a5d3b5a4

Comment by Githook User [ 03/Sep/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-20187 added ThreadPoolTaskExecutor::cancelAllCommands() to cancel active commands on the network interface
Branch: master
https://github.com/mongodb/mongo/commit/34d2549b34620768d85bbf8cb7c2a364db8cc1dc

Comment by Githook User [ 02/Sep/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-20187 added cancelAllCommands to ASIO network interface

Not implemented for NetworkInterfaceImpl or NetworkInterfaceMock
Branch: master
https://github.com/mongodb/mongo/commit/5fa5befcc722efc4420b8d82b15200787260dd00

Comment by Eric Milkie [ 02/Sep/15 ]

We're going to use the Network ASIO functionality to cancel the outstanding network call. We can make a passthrough function in bgsync to call cancel on either the task executor or the network interface, whichever is more appropriate.

Comment by Eric Milkie [ 28/Aug/15 ]

In order to wake it up early, we need to make the NetworkInterface close the socket associated with a task when cancel is called. This will wake up the Fetcher.

Comment by Eric Milkie [ 28/Aug/15 ]

In addition, the bgsync thread blocks waiting for getMore to return; we need to wake it up early when transitioning to primary and entering drain mode.

Generated at Thu Feb 08 03:53:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.