-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
Execution Team 2020-06-29
-
10
Due to a not-well-understood bug in hybrid index builds, we can count (in-memory) more side writes applied than we recorded. This has not caused any data inconsistencies but may cause the server to crash in very rare scenarios.
As of, SERVER-44507, even when the side-writes table is visibly empty, we will return 'false' when writesRecorded does not equal _numApplied such that this invariant fails.
- If _numApplied, the number of keys read from the side table and written into the index, is less than writesRecorded, the number inserted into the side table, this suggests there are keys not visible in our snapshot. We could complete the index build with inconsistencies. This was addressed by
SERVER-44507.
- If, however, _numApplied is greater than writesRecorded, this suggests we either double-counted or double-applied a key. Double counting would suggest a bug in the code that tracks inserts. These counters are only used for progress reporting and invariants, so I am not concerned about this. Double-inserting could be concerning, but indexes allow key overwrites, so we would never introduce an inconsistency in this case, we would just overwrite a previous key.
I would suggest modifying the logic to only return 'false' if _numApplied is less than numRecorded. This partially reverts to the behavior of SERVER-44507, such that we log a warning, but always return 'true' if these counts differ.