[SERVER-2119] In a chunk migration, TO-side shard can't commit before pushing chunk writes to secondary Created: 18/Nov/10  Updated: 12/Jul/16  Resolved: 17/Dec/10

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 1.7.4

Type: Bug Priority: Major - P3
Reporter: Alberto Lerner Assignee: Alberto Lerner
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

db/repl_block.h opReplicatedEnough has to be called in _recvChunkCommit

Here's a race:

> 0) TO-Primary receives last mods for a transfered chunk
> 1) FROM-Primary initiates chunk migration commit calling
> _recvChunkCommit on TO-Primary
> 2) TO-Primary acks it but TO-Secondary hasn't caught up
> 3) FROM-Primary updates config
> 4) TO-Primary dies
> 5) TO-Secondary takes over but it doesn't know about last mods



 Comments   
Comment by auto [ 15/Dec/10 ]

Author:

{u'login': u'alerner', u'name': u'Alberto Lerner', u'email': u'alerner@10gen.com'}

Message: SERVER-2119 push migrated chunk data to secondary/journal at migrate commit
https://github.com/mongodb/mongo/commit/2325d9c61a59fcbcdd5d981700a7fd1a64f5d4ca

Comment by auto [ 15/Dec/10 ]

Author:

{u'login': u'alerner', u'name': u'Alberto Lerner', u'email': u'alerner@10gen.com'}

Message: SERVER-2119 expose the number of known slaves
https://github.com/mongodb/mongo/commit/057443fa137c87d950b92070213a753b975abbac

Comment by Hampus Wessman [ 01/Dec/10 ]

Just want to add that if the TO-side shard is a replica set, then it probably should wait for it to replicate to a majority of the members in that replica set (ie possibly more than one other server). It's not good if data that has once been safely written to a majority of servers in a replica set suddenly ends up on only a minority (in another shard) and thus risks getting lost on a failover!

Comment by auto [ 18/Nov/10 ]

Author:

{'login': 'alerner', 'name': 'Alberto Lerner', 'email': 'alerner@10gen.com'}

Message: SERVER-2119 Just to tie code site and JIRA item
/mongodb/mongo/commit/2478a98d7992a79b783250efe64647d8fd1374cf

Generated at Thu Feb 08 02:59:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.