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

Skip side writes if both keys and multikeypaths are empty

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Gone away
    • None
    • None
    • None
    • None
    • ALL
    • 8

    Description

      When key generation encounters a suppressible error (e.g. during initial sync), we clear both the output key set and multikeypaths vector.

      Even after key generation fails, we still call IndexBuildInterceptor::sideWrite, which can initialize _multikeypaths to a vector of zero-length, even if the actual index spec has non-trivial multikey paths. This will trigger invariants when attempting to merge multikeypaths from valid keys later one with non-trivial multikeypaths.

      To solve this problem, I think we should skip initializing/merging the _multikeypaths when both the key set and the multikeypaths are empty. This suggests that key generation failed (and cleared both containers) or there is no useful multikey information to update and no indexable keys.

      See SERVER-39705 which is related.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-execution Backlog - Storage Execution Team
              louis.williams@mongodb.com Louis Williams
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: