-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
ALL
-
-
131
There is currently a race condition between the POS and the PrimaryOnlyServiceClientObserver.
When a new primary steps up, we transition from the kRebuilding to the kRunning state in the POS.
In this case since the instance starts running before we are able to transition from `kRebuilding` to `kRunning. We create the OperationContext during the `run` of the PrimaryOnlyService, the PrimaryOnlyService will actually kill the OpCtx while being in that transition.
The reason why the operation context is killed is because during that transition the PrimaryOnlyServiceClientObserver which will register the OperationContext will check the current state and find that the current state is indeed kRebuilding. However the second condition which is to check if `allowOpCtxWhileRebuilding` is set to true will no longer be true due to the
AllowOpCtxWhenServiceRebuildingBlock running out of scope and reseting the allowOpCtxWhileRebuilding flag to false.
We end up in a state where we are rebuilding but no longer are allowing the Operation Context while rebuilding and are not in the kRunning state yet.
Since the instance starts running before the POS state is able to transition from the `kRebuilding` state to the `kRunning` state,
- is related to
-
SERVER-51650 Primary-Only Service's _rebuildCV should be notified even if stepdown happens quickly after stepup
- Closed