[SERVER-12658] split chunk error empty makes poor message to end user Created: 07/Feb/14  Updated: 29/Jan/18  Resolved: 28/Aug/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.4.9, 2.5.5
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Asya Kamsky Assignee: Hugh Han
Resolution: Done Votes: 0
Labels: neweng, polish
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Minor Change
Operating System: ALL
Sprint: Sharding 10 (02/19/16)
Participants:

 Description   

When trying to run split chunk command with boundaries or with sh.splitFind() command and there are no documents in the collection, the error received back is:

> sh.splitFind(ns, {_id:1})
{ "cause" : { }, "ok" : 0, "errmsg" : "split failed" }

The logs for mongos says:

 m30999| 2014-02-07T14:57:49.007-0500 [conn3] splitting chunk [{ _id: 5764607523034234880 },{ _id: 6148914691236517204 }) in collection test.clicks2014w5 on shard shard0002
 m30002| 2014-02-07T14:57:49.010-0500 [conn4] command admin.$cmd command: { splitVector: "test.clicks2014w5", keyPattern: { _id: "hashed" }, min: { _id: 5764607523034234880 }, max: { _id: 6148914691236517204 }, force: true } ntoreturn:1 keyUpdates:0 numYields:0 locks(micros) r:100 reslen:53 0ms
 m30999| 2014-02-07T14:57:49.011-0500 [conn3] want to split chunk, but can't find split point chunk ns: test.clicks2014w5, shard: shard0002:localhost:30002, lastmod: 3|85||000000000000000000000000, min: { _id: 5764607523034234880 }, max: { _id: 6148914691236517204 } got: <empty>

because field is not being populated, making it more harder to figure out why the split failed.



 Comments   
Comment by Ian Whalen (Inactive) [ 28/Aug/17 ]

Re-opening to resolve as Gone Away since we do not have a specific version where we know this was fixed.

Comment by Hugh Han [ 20/Jun/17 ]

I believe the error message has already been fixed for both

db.adminCommand( { split: "<database>.<collection>",
                   bounds: [ <lower>, <upper> ] } )

and

sh.splitFind( "<database>.<collection>", query )

whenever <database>.<collection> is empty, as of the current master version.

Attempting to do so returns the following message, for both commands.

{
	"code" : 87,
	"ok" : 0,
	"errmsg" : "Unable to find median in chunk, possibly because chunk is empty.",
	...
}

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