[SERVER-14728] Shard depends on string comparison of replica set connection string Created: 30/Jul/14  Updated: 11/Mar/15  Resolved: 07/Aug/14

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 2.6.6, 2.7.5

Type: Bug Priority: Major - P3
Reporter: Jonathan Reams Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Tested
Operating System: ALL
Backport Completed:
Steps To Reproduce:
  1. Start a sharded replica set and shard a collection.
  2. Update the shards collection in the config database so the shards are in a different order

    > db.shards.find({_id: "rs0"})
    { "_id" : "rs0", "host" : "rs0/host1.example.com:27017,host2.example.com:27017" }
    > db.shards.update({_id: "rs0"}, { $set: { "host": "rs0/host2.example.com:27017,host1.example.com:27017" }})
    WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })

  3. Try to drop a sharded collection on the now-inconsistent shard - you should get

    mongos> db.testcoll.drop()
    Thu Jul 24 10:06:40.696 drop failed: {
        "code" : 13129,
        "ok" : 0,
        "errmsg" : "exception: can't find shard for: rs0/host1.example.com,host2.example.com"
    } at src/mongo/shell/collection.js:383

Participants:

 Description   

If there's a replicaset reconfiguration, so the order hosts are listed in the connection string changes, then mongos won't be able to find information about the shard, because it does a string comparison of the two connection strings instead of parsing them and comparing the items in the list.



 Comments   
Comment by Githook User [ 24/Nov/14 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-14728 Shard depends on string comparison of replica set connection string

Fix iterator incompatible issue.

(cherry picked from commit e97e4f04874a10a3d427a23eb3de4f97234b8c89)
Branch: v2.6
https://github.com/mongodb/mongo/commit/17074f4f3e0e3c2572f248dee804cfbe66cebf1d

Comment by Githook User [ 24/Nov/14 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: Revert "Revert "SERVER-14728 Shard depends on string comparison of replica set connection string""

This reverts commit d261864e9156af7ecc3d0491111dffa0161e9d0d.

(cherry picked from commit 50601136fc8b9399a1832b84396e74e7bc9011c5)
Branch: v2.6
https://github.com/mongodb/mongo/commit/c7fa0c9cec91f0b9bef31c00ae5a0df6cb7a1cf8

Comment by Githook User [ 08/Aug/14 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-14728 Shard depends on string comparison of replica set connection string

Fix iterator incompatible issue.
Branch: master
https://github.com/mongodb/mongo/commit/e97e4f04874a10a3d427a23eb3de4f97234b8c89

Comment by Githook User [ 08/Aug/14 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: Revert "Revert "SERVER-14728 Shard depends on string comparison of replica set connection string""

This reverts commit d261864e9156af7ecc3d0491111dffa0161e9d0d.
Branch: master
https://github.com/mongodb/mongo/commit/50601136fc8b9399a1832b84396e74e7bc9011c5

Comment by Githook User [ 07/Aug/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-14728 Shard depends on string comparison of replica set connection string"

This reverts commit b3787777795434829a3b512c06b5a0a508d81467.
Branch: master
https://github.com/mongodb/mongo/commit/d261864e9156af7ecc3d0491111dffa0161e9d0d

Comment by Githook User [ 07/Aug/14 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-14728 Shard depends on string comparison of replica set connection string
Branch: master
https://github.com/mongodb/mongo/commit/b3787777795434829a3b512c06b5a0a508d81467

Generated at Thu Feb 08 03:35:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.