Secondary background index builds may complete at any time after they start. It's important the completion is timestamped in order relative to other operations on the collection, but it's not intrinsically important what timestamp it gets (there are however some external constraints):
- Choosing a time that hasn't yet been seen by the system can result in readers to wait for an optime that will never come.
- Choosing a time that has already happened can race with setting the stable timestamp.
Of the two constraints, the first one is more sensitive to testing failures. The proposed solution is to continue to timestamp the write with the latest logical clock value, but retry (instead of fasserting) in the event the index completion lost the race with the stable timestamp.