Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-48532

[4.2] IndexBuildInterceptor::areAllWritesApplied may return false despite all records being visibly applied

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.9
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Execution Team 2020-06-29
    • Linked BF Score:
      10

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            gregory.noma Gregory Noma
            Reporter:
            louis.williams Louis Williams
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: