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

Skip side writes if both keys and multikeypaths are empty

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • ALL
    • 8

      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.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: