When using a non-w:1 write concern, waiting for write concern will fail if the primary steps down. If the write is retried before the former primary updates its state, then the same node will attempt to complete the write. In the case of a collection creation or drop, the node will error because the operation already happened (rather than failing with a NotWriteablePrimary error). Our stepdown tests skip retrying again since they think that the write finally succeeded and I could imagine that users/applications would behave similarly. If the new primary skips primary catchup (like our stepdown tests) or primary catchup times out, then it might not have the write that we assumed succeeded.
In our test this can manifest as extra/incorrect/missing documents since the test progresses past the operation even though it did not make it onto the new primary.
- is caused by
-
SERVER-56963 Prevent secondaries from waiting for write concern when they've taken write locks
- Closed