[SERVER-11876] splitChunk returns error but splits anyway, no entry in changelog Created: 27/Nov/13  Updated: 15/Jan/19  Resolved: 14/Jan/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.0.9, 2.2.6, 2.4.8
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Thomas Rueckstiess Assignee: Matthew Saltz (Inactive)
Resolution: Done Votes: 0
Labels: neweng, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File movelastchunksplit.js    
Issue Links:
Related
Operating System: ALL
Participants:

 Description   

Moving the last chunk away from a shard, then back onto that shard, and trying to split it will cause an error. The chunk is still split though. The split does not appear in the changelog however.

Error:

{
	"cause" : {
		"errmsg" : "exception: couldn't find chunk { _id: MinKey }->{ _id: MaxKey }",
		"code" : 13586,
		"ok" : 0
	},
	"ok" : 0,
	"errmsg" : "split failed"
}

jstest attached.

The test fails in all mentioned affected versions. In 2.5.4 it succeeds without failure.



 Comments   
Comment by Matthew Saltz (Inactive) [ 14/Jan/19 ]

Repro seems to pass on master. Closing as gone away.

The revised repro to work on master is:

(function() {
s = new ShardingTest({name: "server11876", shards: 2, mongos: 1, other: {chunkSize: 1}});
s.stopBalancer();
 
assert.commandWorked(s.s.adminCommand( { enableSharding : "test" } ));
assert.commandWorked(s.s.adminCommand( { shardcollection : "test.foo" , key : { _id : 1 } } ));
 
assert.commandWorked(s.s.adminCommand( { movechunk : "test.foo" , find : { _id : 42 } , to : s.shard1.shardName } ));
sleep(2000);
 
assert.commandWorked(s.s.adminCommand( { movechunk : "test.foo" , find : { _id : 42 } , to : s.shard0.shardName } ));
sleep(2000);
 
// this fails in 2.4.8, 2.4.6, 2.2.6, 2.0.9
assert.commandWorked(s.splitAt('test.foo', {_id : 42}));
s.stop();
})();

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