Initial sync may fail with IndexOptionsConflict when applying stale startIndexBuild oplog entry if the stale (i.e. dropped) index has the same spec as a more up-to-date index under a different name.
More specifically, let's say the primary creates {a: 1} with name "a1", drops it, then re-creates the same index with name "a2", and initial sync clones "a2" but later needs to re-apply createIndex of "a1". In this case, initial sync would fail with IndexOptionsConflict when applying "a1".
SERVER-47164 added code to handle name conflicts during initial sync but it doesn't handle spec conflicts (under different index name).
- related to
-
SERVER-47164 Drop any existing indexes conflicting with the specs from the startIndexBuild oplog entry during initial sync
- Closed