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

prefix shard keys index bounds handling

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.0-rc2, 2.3.0
    • Affects Version/s: 2.2.0-rc1
    • Component/s: None
    • None
    • Fully Compatible
    • ALL

      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.

        1. deletion_range.js
          2 kB
          Greg Studer

            Assignee:
            matulef Kevin Matulef
            Reporter:
            greg_10gen Greg Studer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: