Summary
ShardingMigrationCriticalSection used to control access logic during migration.
It currently allows observing when a collection or database leaves critical section.
This change will allow observing entering a critical section and checking if a collection or database is in a critical section to enable follow up improvements in the migration protocol i.e. SERVER-35219
Implementation:
1. add a signal to observe entering the critical section and modify an API to get the signal/
enum Transition { kEnterCriticalSection, kExitCriticalSection};
|
std::shared_ptr<Notification<void>> getSignal(Transition, Operation) const;
|
2. add a method to check if the collection / database is in the critical section.
bool inCriticalSection() const;
|
3. set the notification to enter a critical section
set the signal here
|