[SERVER-20275] collMod fails on the sharded collection if the collection does not exists on all shards Created: 03/Sep/15  Updated: 06/Dec/22  Resolved: 08/Mar/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.0.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Anil Kumar Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File coll_mod.js    
Issue Links:
Related
Assigned Teams:
Sharding
Operating System: ALL
Steps To Reproduce:
  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.
Sprint: Sharding 10 (02/19/16)
Participants:
Case:

 Description   

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.



 Comments   
Comment by Esha Maharishi (Inactive) [ 08/Mar/18 ]

This issue was fixed in v3.6 by this line in this commit.

Comment by Randolph Tan [ 12/Feb/16 ]

Note that even though the command returns an error for the shard, the cluster is not in an error state since the shard does not have the collection. When a chunk is moved to this shard, the collection metadata will be copied over as part of the migration protocol.

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