reIndex does writes (both timestamped and untimestamped) but it does not acquire new optimes for such writes; it just piggybacks on whatever the current logical clock time is.
This renders the minimumVisibleSnapshot mechanism somewhat ineffective, since that requires new timestamps to be created for each write that is to be protected.
Because multi-document transactions establish a snapshot protected only by a Global lock and not a Database lock, it is possible to establish a snapshot in between a begin-index-build write and a commit-index-build write performed by a reIndex. Because the snapshot read time can be outside the minimumVisibleSnapshot time on the collection, such a snapshot can then see that the in-memory catalog shows the index as being ready, even though the storage engine catalog will show the index as being not-ready. This discrepancy can cause problems, including invariant failures.
- is related to
-
SERVER-44026 Remove global X lock for reIndex
- Closed