[SERVER-17912] Primary shard for a DB is assigned to last shard node Created: 07/Apr/15 Updated: 24/Apr/15 Resolved: 08/Apr/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.1.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jonathan Abrahams | Assignee: | Jonathan Abrahams |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | 32qa | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Operating System: | ALL | ||||
| Steps To Reproduce: | Scenario
The primary shard node for the DBs are
|
||||
| Participants: | |||||
| Description |
|
If a database has been created on a shard node, before it's been sharded, the enabledSharding() will associate the primary shard to the last shard node in the cluster. This happens for all databases, except for the first one which is enabled. |
| Comments |
| Comment by Jonathan Abrahams [ 08/Apr/15 ] |
|
Could not reproduce as originally described. There is an assignment of the primary shard to a new DB, after sharding has been enabled, where it is always assigned to the same shard node, which may not be the other holding the DB. This is not the recommended method, as once sharding has been enabled, it is not recommended to directly connect to a shard node (mongod) to create new DBs and collections. |
| Comment by Jonathan Abrahams [ 07/Apr/15 ] |
|
If the user then shards a collection, then the resulting chunk will be on the primary node, which does not hold the data. The data on the non-primary node is not visible via mongos. |
| Comment by Jonathan Abrahams [ 07/Apr/15 ] |
|
Perhaps the primary should be the node which has the DB. |