The ScopedSetShardRole aim is to set a shardVersion and dbVersion into the OperatingShardingState during the object lifespan.
However, if the construction of the object fails, the destructor won't be called so we could end up having an inconsistent OperatingShardingState.
This ticket aims to make sure that any change done on ScopedSetShardRole constructor will be reverted in case of an error.
- depends on
-
SERVER-85911 Get rid of unsetShardRoleForLegacyDDLOperationsSentWithShardVersionIfNeeded
- Closed
- is caused by
-
SERVER-64057 Implement a scoped object for setting the expected shard/database versions
- Closed