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

Resharding's initial split points for hashed shard keys don't match the sampled values

    • Fully Compatible
    • ALL
    • v5.0
    • Sharding 2021-07-12, Sharding 2021-07-26
    • 35
    • 1

      ReshardingSplitPolicy::_appendSplitPointsFromSample() hashes the already-hashed shard key value for a second time by calling shardKey.extractShardKeyFromDoc(*nextKey). A solution is probably to use dotted_path_support::extractElementsBasedOnTemplate(*nextKey, shardKey.toBSON()) instead, which is how the shard key is extracted for oplog entries.

      (This bug was found via code inspection while tracking down SERVER-58047.)

            Assignee:
            luis.osta@mongodb.com Luis Osta (Inactive)
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: