Details
Description
An invariant is hit when an index exists in memory (because it has completed), but it is not yet visible on the storage engine when reading at an earlier timestamp.
A query that reads from a timestamp is allowed to yield. When its locks are reacquired and it reads again, say it reads from a newer timestamp, T1. If an index build occurs during the yield at T2, and the read timestamp on the query is before the index build timestamp, iterating through the list of indexes on a collection can trigger this invariant.
Rather than always triggering an invariant, we should just not show the index as ready. This will only be the case when the current operation is reading from a timestamp and the index is marked ready in memory but not visible on the storage engine.