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

prefix shard keys index bounds handling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.2.0-rc1
    • Fix Version/s: 2.2.0-rc2, 2.3.0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      If we shard over

      { x : 1 }

      with index

      { x : 1, y : 1 }

      , and have chunks A:

      {x:2}

      ->

      {x:3}

      and B:

      {x:3}

      ->

      {x:4}

      , a document D :

      { x : 3, y : "abcde" }

      is currently included in migrations and other operations for both A and B.

      This is b/c when we get index key bounds from the prefix, we complete them with MinKey for min and MaxKey for max, so the index max bound of A is

      {x:3,y:MaxKey}

      and the index min bound of B is

      {x:3,y:MinKey}

      , and both ranges overlap D. Included test shows how this results in extra documents removed during migration.

      Proposed solution - complete with just MinKey?

      The problem is harder to trigger with our standard tests with _id indexes, not sure why.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: