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

"best-effort" setShardVersion sent from donor to recipient after chunk migration commit always fails if this was first chunk migrated to recipient

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.4, 3.7.9
    • Component/s: Sharding
    • Labels:
      None
    • Sharding
    • 41

      This is because the donor shard sends authoritative=false in its setShardVersion request to the recipient, and setShardVersion requires authoritative=true if the shard does not have in-memory sharding state for this shard (which happens, for example, after the shard restarts or if this is the first chunk being received by the shard).

      I think the fix is just to send authoritative=true, but we should probably also add some testing.

      Noticed because of this log line while investigating a build failure:

      d23011| 2018-03-16T19:26:02.396+0000 I COMMAND  [conn18] command admin.$cmd appName: "MongoDB Shell" command: setShardVersion { setShardVersion: "foo.bar", init: false, authoritative: false, configdb: "upsert_sharded-configRS/ip-10-122-13-51:23012,ip-10-122-13-51:23013,ip-10-122-13-51:23014", shard: "upsert_sharded-rs1", shardHost: "ip-10-122-13-51:23011", version: Timestamp(2, 1), versionEpoch: ObjectId('5aac1a47a06d48723a19335e'), noConnectionVersioning: true, $clusterTime: { clusterTime: Timestamp(1521228362, 11), signature: { hash: BinData(0, F7FE62FC747161A2C451B9B9300408EF051CC7F8), keyId: 6533625978638303251 } }, $client: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "3.7.3-66-gf092c84d7f" }, os: { type: "Linux", name: "Red Hat Enterprise Linux Server release 6.2 (Santiago)", architecture: "x86_64", version: "Kernel 2.6.32-220.el6.x86_64" }, mongos: { host: "ip-10-122-13-51:23015", client: "127.0.0.1:45799", version: "3.7.3-66-gf092c84d7f" } }, $configServerState: { opTime: { ts: Timestamp(1521228362, 11), t: 2 } }, $db: "admin" } numYields:0 ok:0 errMsg:"first time for collection 'foo.bar'" errName:UnknownError errCode:8 reslen:451 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_msg 0ms

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: