[SERVER-22590] applyChunkOpsDeprecated retries and throws an error on preCondition no longer matching because the original write worked Created: 12/Feb/16  Updated: 19/Nov/16  Resolved: 25/Feb/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.2.4, 3.3.3

Type: Bug Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Dianna Hohensee (Inactive)
Resolution: Done Votes: 0
Labels: code-and-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-22849 Shard registry should update config l... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Sharding 10 (02/19/16), Sharding 11 (03/11/16)
Participants:
Linked BF Score: 0

 Description   

If the applyChunkOpsDeprecated's applyOps write works, but doesn't send back OK, it will retry. However, because the first write worked, the precondition does not match and it returns an error. applyChunkOpsDeprecated should double check whether the chunk changes did actually make it into the oplog, and if so return success.

moveChunk already deals with this issue, but splitChunk and mergeChunk do not. ChunkMoveOperationState::commitMigration looks at the result of applyChunkOpsDeprecated and if there's an error reloads the chunk information from the oplog and checks to see if the new version number is there – if so, it succeeded.

Potential solution:
add a parameter (ChunkType?) to applyChunkOpsDeprecated that holds the last chunk and chunk version of the ops being applied by applyOps. Move the applyOpsStatus logic in ChunkMoveOperationState::commitMigration into applyChunkOpsDeprecated and generalize it to handle move/split/merge versioning checks.



 Comments   
Comment by Githook User [ 25/Feb/16 ]

Author:

{u'username': u'DiannaHohensee', u'name': u'Dianna Hohensee', u'email': u'dianna.hohensee@10gen.com'}

Message: SERVER-22590 improve applyChunkOpsDeprecated to check for false failures in chunk operations

(cherry picked from commit ff296b3279257d2ff8e53ee90eb0f6a6f5c562f4)
Branch: v3.2
https://github.com/mongodb/mongo/commit/77358fcc55c37446a1964441ab27b3fb19f4b060

Comment by Githook User [ 24/Feb/16 ]

Author:

{u'username': u'DiannaHohensee', u'name': u'Dianna Hohensee', u'email': u'dianna.hohensee@10gen.com'}

Message: SERVER-22590 improve applyChunkOpsDeprecated to check for false failures in chunk operations
Branch: master
https://github.com/mongodb/mongo/commit/ff296b3279257d2ff8e53ee90eb0f6a6f5c562f4

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