Details
-
Bug
-
Resolution: Works as Designed
-
Major - P3
-
None
-
6.0.0-rc12
-
None
-
None
-
ALL
-
v6.0
Description
Currently, the index scan for setting the orphan document count during upgrade to 6.0 is taking the ScopedRangeDeleterLock (which will take global in IX, config.rangeDeletions in IX, and RangeDeleterCollLock::<collection UUID> in mode X. We then perform and index scan in which we pass the yield policy YIELD_AUTO. Yield auto will yield after a WriteConflictException, after a certain amount of time has passed, or after a certain number of documents have been fetched. When yielding, we will release and reacquire all locks, including the ones for the ScopedRangeDeleter lock. In this case, a range deletion could acquire the ScopedRangeDeleterLock in the middle of the index scan and change the orphan documents, thus messing up the count of orphan documents.
We should change the yield policy to NO_YIELD to ensure the locks aren't released during the index scan.