|
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.
|