[SERVER-26365] mergeChunks fails with empty error message if merging chunks that were moved Created: 28/Sep/16  Updated: 21/Nov/16  Resolved: 18/Oct/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.2.9
Fix Version/s: 3.2.11

Type: Bug Priority: Major - P3
Reporter: Kevin Adistambha Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: code-and-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File mergeChunks-empty-error.js    
Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

1. Create a sharded cluster with 2 shards.
2. Split a sharded collection into 4 chunks (e.g. c1, c2, c3, c4)
3. Move two chunks into another shard (e.g. c2, c3)
4. Merge the chunks c2 and c3

Sprint: Sharding 2016-10-10, Sharding 2016-10-31
Participants:

 Description   

mergeChunks fails with empty error message if merging chunks that were moved.

This issue was originally reported in Google Groups: https://groups.google.com/forum/#!topic/mongodb-user/cN6Etk06S4g

The error shown in the mongo shell is:

{ "ok" : 0, "errmsg" : "" }

The error shown in the log is:

BadValue: chunk operation commit failed: version 3|2||57eb2b8706ec6135f8ef76eb doesn't exist in namespacetest.test. Unable to save chunk ops.

The cause for the error is that the version mentioned in the logs doesn't exist in the chunks collection in the config database. It was looking for version (3,2), while the last entry in the chunks collection is version (3,1).

Jstest to reproduce the issue is attached.



 Comments   
Comment by Percy Legendre IV [ 03/Nov/16 ]

Hello, looks like you all are taking care of the issue. But I just wanted to reaffirm that it still exists atm.

I am taking M202: MongoDB Advanced Deployment and Operations. A quiz problem had us merge chunks. Instead of simply merging two chunks on the same shard, I moved a chunk, then attempted to merge. It's failing with: ok: 0 and errmsg: ""

This is with shell 3.2.1.

Comment by Githook User [ 19/Oct/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-26365 Forward port changes to merge_chunks_test.js to master
Branch: master
https://github.com/mongodb/mongo/commit/59bfd84718bc931f3871a8d53e53edb004434788

Comment by Githook User [ 18/Oct/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-26365 Make mergeChunks use collection version for applyOps precondition
Branch: v3.2
https://github.com/mongodb/mongo/commit/0fc6434e6e37b0eec1074ccb2e4aa4913947e008

Comment by Kaloian Manassiev [ 14/Oct/16 ]

Nevermind, I was trying to reproduce it on 3.4.0-rc1. It still reproduces on 3.2.10.

Comment by Kaloian Manassiev [ 14/Oct/16 ]

Hi kevin.adistambha,

This issue seems to have been fixed in this commit as a side effect of fixing SERVER-25602 and is available in 3.2.10.

With a slight change to your attached js test (to merge from [MinKey, 20) instead of from [0, 20), which fall on the same shard) I am getting this more appropriate error code:

assert: command failed: {
        "ok" : 0,
        "errmsg" : "could not merge chunks, collection test.test range ending at { a: 20.0 } does not belong to shard shard0000"
}

Thank you for reporting it.

-Kal.

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