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

When duplicate oids are found by the balancer, validate the replica set name

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 2.0.3, 2.1.0
    • Component/s: Sharding
    • Environment:
      All
    • Sharding EMEA
    • Sharding EMEA 2023-01-23, Sharding EMEA 2023-02-06, Sharding EMEA 2023-02-20, Sharding EMEA 2023-03-06

      Currently, Balancer::_checkOIDs() produces this error message if duplicate oids are detected:

          log() << "error: 2 machines have " << x << " as oid machine piece " << s.toString() << " and " << oids[x].toString() << endl;
      

      This error message can occur if the config server's shards collection contains unique 'host' strings, but with the same replica set name. The following configuration error could cause this:

      mongos> db.shards.find()
      { "_id" : "sh1", "host" : "rs1/localhost:27017,localhost:27018,localhost:27019" }
      { "_id" : "sh2", "host" : "rs1/localhost:27027,localhost:27028,localhost:27029" }
      

      The intended configuration is to use 'rs2' for the second line in this example. Although quite rare, this is a very easy error to overlook because the hostnames and shard names are correct. It might be nice to add logic to detect and print a more robust error message when multiple shards are pointing at the same replica set name.

      Note that this check could likely live in MoveChunkCommand and SplitChunkCommand.

            Assignee:
            sergi.mateo-bellido@mongodb.com Sergi Mateo Bellido
            Reporter:
            benjamin.becker Ben Becker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: