[SERVER-17904] Auto- and User-Generated-Shard Names May Colide Created: 07/Apr/15 Updated: 06/Dec/22 Resolved: 09/Dec/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.0.1 |
| Fix Version/s: | 3.4.9 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | John Page | 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 | ||
| Assigned Teams: |
Sharding
|
|||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | |||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: |
|
|||||||||||||||||||||||||||||||||||||||
| Participants: |
| Description |
|
When I add a third shard to a cluster where the first one was explicitly named and the second wasn't I get a duplicate key error and cannot add the shard. I saw this starting a cluster with mlaunch then adding a second shard. |
| Comments |
| Comment by Sheeri Cabral (Inactive) [ 09/Dec/19 ] | |
|
it has been fixed at least since 3.4 if not before. | |
| Comment by Sam Kleinman (Inactive) [ 08/Apr/15 ] | |
|
Verified the issue. Appears to be in the logic for picking auto-generated shard names in this function: https://github.com/mongodb/mongo/blob/master/src/mongo/s/catalog/legacy/catalog_manager_legacy.cpp#L829-856 | |
| Comment by John Page [ 08/Apr/15 ] | |
|
That was a simple typo - all three shards have their own directories. Notable that the first unnamed shard gets 0002 for some reason (not 0000 or 0001) I don't have this set up anymore - but if you basically copy and paste the instructions do you not see the same error? | |
| Comment by Sam Kleinman (Inactive) [ 08/Apr/15 ] | |
|
A few additional questions: First, from the steps you provided, in shell 5, you started a second instance using the same dbpath as shard1/shell 3, and that nothing uses the shard3 directory. Is th Second, could you provide the output of the following operation:
from the mongo shell while connected to a mongos? |