[SERVER-5387] moveChunk find:{$minKey:1} matches incorrect chunk Created: 23/Mar/12 Updated: 06/Dec/22 Resolved: 31/Jan/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding, Shell |
| Affects Version/s: | 2.0.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Y. Wayne Huang | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Done | Votes: | 0 |
| Labels: | sharding | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Sharding
|
||||
| Operating System: | ALL | ||||
| Participants: | |||||
| Description |
|
we have a sharded collection "x", with chunks:
from mongos:
is it incorrectly "finding" the last chunk? |
| Comments |
| Comment by Y. Wayne Huang [ 05/Apr/12 ] | ||||||
|
seems reasonable to me. obviously not a huge issue w/ a known workaround but it would be great to get this scheduled some time or see some sort of movement toward getting it fixed. | ||||||
| Comment by Antoine Girbal [ 28/Mar/12 ] | ||||||
|
The general rule is that special objects get printed out as their own type. For example the following are now printing correctly in 2.1:
So here it makes sense to fix to:
| ||||||
| Comment by Y. Wayne Huang [ 26/Mar/12 ] | ||||||
|
Hi Scott - thanks, using the constant worked although I would guess that most users' first inclination would be to use {"$minKey":1}because it's what is returned in db.printShardingStatus(). | ||||||
| Comment by Scott Hernandez (Inactive) [ 26/Mar/12 ] | ||||||
|
You want to the use the Min/MaxKey constant.
You do not want to use " { $maxKey : 1 }" which is just a document, not a special thing like you want. Also, '"email": {"$lt":"0"}' will find the lowest numeric value, not the lowest possible value which is why you want to use MinKey. http://www.mongodb.org/display/DOCS/What+is+the+Compare+Order+for+BSON+Types | ||||||
| Comment by Eliot Horowitz (Inactive) [ 26/Mar/12 ] | ||||||
|
This is a display/parsing issue in the shell. round trips right now. |