[SERVER-38522] All the coordinator asynchronous tasks should be interruptible Created: 10/Dec/18  Updated: 29/Oct/23  Resolved: 22/Feb/19

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

Type: Improvement Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Kaloian Manassiev
Resolution: Fixed Votes: 0
Labels: ShardedTxn:DistributedCommit
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-37881 Coordinator should time out waiting f... Closed
is depended on by SERVER-38715 A coordinator should cancel its cance... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2018-12-31, Sharding 2019-01-14, Sharding 2019-01-28, Sharding 2019-02-11, Sharding 2019-02-25
Participants:

 Description   

And should get interrupted on stepdown, because stepup waits for them to quiesce.



 Comments   
Comment by Githook User [ 22/Feb/19 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-38522/SERVER-38715 Make all TransactionCoordinator tasks interruptible
Branch: master
https://github.com/mongodb/mongo/commit/63220b7df242b26f83c7083394b463c4e4b3a5d8

Comment by Githook User [ 22/Feb/19 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-38522 Reduce the execution time and logging of sharding MongoD tests
Branch: master
https://github.com/mongodb/mongo/commit/cdc5a7e8fe27e66b4a5f862cf9624130fd5e4eeb

Comment by Githook User [ 22/Feb/19 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-38522 Add an `onCommands` syntactic sugar to ShardingTestFixtureCommon

In order to allow multiple commands to be waited on and their responses
scheduled atomically.
Branch: master
https://github.com/mongodb/mongo/commit/a0aff96a9c28b7fd75506eccdea23c241a377d75

Comment by Githook User [ 03/Jan/19 ]

Author:

{'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com', 'name': 'Kaloian Manassiev'}

Message: SERVER-38522 Make persistParticipantList/persistDecision/deleteCoordinatorDoc asynchronous

Also splits TransactionCoordinator util into driver and futures components
Branch: master
https://github.com/mongodb/mongo/commit/310b84d607506406c78925693b4bf71dd95e35e5

Comment by Matthew Saltz (Inactive) [ 14/Dec/18 ]

The current idea for the implementation of this is to have a class CoordinatorExecutionContext that a TransactionCoordinator will own by value and use to interact with the network and disk (the "outside world"). This layer will be cancelable so that TransactionCoordinator only has to handle cancelation in an onError continuation. The interface for CoordinatorExecutionContext can look something like this:

class CoordinatorExecutionContext {
public:
    /**
     * Sends a command to a shard. If an outstanding command is canceled an error status (maybe ErrorCodes::CallbackCanceled, 
     * maybe something else) will be set on the returned Future.
     *
     * If the function is called while this is already canceled, it must return a ready Future with an error status already set in it. 
     */
    Future<void> sendAsyncCommandToShard(...);
 
    // Similar concept but this will use an OperationContext
    Future<void> persistDocument(...);
    /**
     * Iterates through all active callback handles and all active OperationContexts and cancels them,
     * in turn triggering all outstanding futures with errors.
     */
    void cancel();
 
private:
    TaskExecutor *executor; // Will be used for scheduleRemoteCommand
    ThreadPool *threadPool; // Will be used for disk I/O
    bool _canceled;
    std::vector<CallbackHandle> _callbackHandles;
    std::vector<OperationContext*> _opCtxs;
};

TransactionCoordinator::cancel will then just call CoordinatorExecutorContext::cancel.

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