We call prepareInsertDeleteOptions once when initializing an index build, but as a resultthe GetKeysMode does not change dynamically as the replication state changes.
Consider the following sequence where node1 is primary and node2 is secondary.
- Insert { A: invalid}
- start index build on node1 (kEnforceConstraints)
- start index build on node2 (kRelaxConstraints)
- stepUp node2 to primary, node1 is secondary. node2 continues relaxing constraints, and node1 continues enforcing them
- update {A: valid}
- node2 scans A and succeeds because it has seen the update
- node1 scans A and fails because it hasn’t received the update yet
This would be an error because the secondary, node1, fails but the primary, node2, will commit the index build.
- is related to
-
SERVER-39976 Two-phase index builds on primaries should ignore interrupts
- Closed
-
SERVER-44654 allow unique index builds to continue running on stepdown
- Closed
- related to
-
SERVER-45351 Newly-elected primaries can commit index builds with inconsistencies due to ignoring indexing errors as secondary
- Closed