collMod fails on the sharded collection if the collection does not exists on all shards

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.0.0
    • Component/s: Sharding
    • None
    • Sharding
    • ALL
    • Hide
      1. sh.enableSharding("test")
      2. db.getSiblingDB("test").ext.insert({})
      3. sh.shardCollection("test.ext", {_id: 1})
      4. db.stats() -> This would show the database / collection to be only on one of the shard (Primary shard for the database). sh.status() would indicate this as well.
      5. db.runCommand({collMod: "ext"}, {keyPattern: {x: 1}, expireAfterSeconds: 100} ) would succeed only on the Primary shard for this database on which the collection exists and will fail on all other shards resulting in error message being returned in the output.
      Show
      sh.enableSharding("test") db.getSiblingDB("test").ext.insert({}) sh.shardCollection("test.ext", {_id: 1}) db.stats() -> This would show the database / collection to be only on one of the shard (Primary shard for the database). sh.status() would indicate this as well. db.runCommand({collMod: "ext"}, {keyPattern: {x: 1}, expireAfterSeconds: 100} ) would succeed only on the Primary shard for this database on which the collection exists and will fail on all other shards resulting in error message being returned in the output.
    • Sharding 10 (02/19/16)
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The collMod on a sharded collection (when it is not yet migrated to all shards) fails with an error message indicating the non-existence of the collections on some of the shards. This is not an expected behavoiur / failure in case of sharded collection that exists just on the Primary shard. The error has been introduced in 3.0.

        1. coll_mod.js
          0.5 kB
          Randolph Tan

            Assignee:
            [DO NOT USE] Backlog - Sharding Team
            Reporter:
            Anil Kumar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: