[SERVER-22588] "validate" command result is ambiguous/undefined for sharded collections Created: 11/Feb/16 Updated: 26/Apr/16 Resolved: 12/Apr/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Diagnostics |
| Affects Version/s: | 3.3.1 |
| Fix Version/s: | 3.3.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Robert Guo (Inactive) | Assignee: | Robert Guo (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Minor Change | ||||
| Operating System: | ALL | ||||
| Sprint: | TIG 12 (04/01/16), TIG 13 (04/22/16) | ||||
| Participants: | |||||
| Linked BF Score: | 0 | ||||
| Description |
|
When the validate command is run against a sharded collection that does not have a chunk on every shard, the shards without a chunk will report "ns not found" with {ok: 0} and no valid field. This causes the command to report without a valid field at the top level. This result is ambiguous and the drivers do different things to determine if the result is valid or not. For example, pymongo would search for the keyword "valid" and defaults to invalid if not found. The shell, on the other hand, searches for the string "exception" or "corrupt" in the stringified response object and defaults to valid if not found. As a result, pymongo fails but the shell doesn't in this scenario. example output:
|
| Comments |
| Comment by Githook User [ 12/Apr/16 ] |
|
Author: {u'username': u'guoyr', u'name': u'Robert Guo', u'email': u'robert.guo@10gen.com'}Message: |
| Comment by Robert Guo (Inactive) [ 12/Apr/16 ] |
|
Minor change - Previously, the response of validate() is different depending on whether you invoke it on mongod or mongos. Now, validate() through mongos on an unsharded collection will respond in the same format as mongod. For validate() invoked on sharded collections, the response format is unchanged. |
| Comment by Githook User [ 12/Apr/16 ] |
|
Author: {u'username': u'guoyr', u'name': u'Robert Guo', u'email': u'robert.guo@10gen.com'}Message: |
| Comment by Githook User [ 12/Apr/16 ] |
|
Author: {u'username': u'IanWhalen', u'name': u'Ian Whalen', u'email': u'ian.whalen@gmail.com'}Message: Revert " This reverts commit 3caa06819ab544bf9e88f4413c363a6439fe1998. |
| Comment by Githook User [ 12/Apr/16 ] |
|
Author: {u'username': u'guoyr', u'name': u'Robert Guo', u'email': u'robert.guo@10gen.com'}Message: |