[SERVER-23377] _migrateClone can keep on returning the same document Created: 28/Mar/16  Updated: 14/Apr/16  Resolved: 30/Mar/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.3.3
Fix Version/s: 3.3.4

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-17788 Upgrade to gperftools 2.5 Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 12 (04/01/16)
Participants:
Linked BF Score: 0

 Description   

and can theoretically result in a migration that never ends.

The issue is caused by yielding here:

https://github.com/mongodb/mongo/blob/84223317a67211cf19d9ef1e944ef3fe12a819ac/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp#L421

Here, we break early and if the iterator didn't move then the erase here:

https://github.com/mongodb/mongo/blob/84223317a67211cf19d9ef1e944ef3fe12a819ac/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp#L426

will end up erasing nothing. A potential fix is to move the yield check at top to make sure that the iterator is not equal to the begin iterator when the command added a document to the response buffer (with a check that it is not equal to the begin iterator, otherwise, we can end up with a different problem of not returning any document).



 Comments   
Comment by Githook User [ 30/Mar/16 ]

Author:

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

Message: SERVER-23377 Make sure _migrateClone always advances to next document
Branch: master
https://github.com/mongodb/mongo/commit/e47ce9f899d09eba1cbdb45cc433786f5510e41a

Comment by Randolph Tan [ 29/Mar/16 ]

schwerin This is a bug introduced by a recent commit in master.

Comment by Andy Schwerin [ 28/Mar/16 ]

Is this from the migration refactor on the master branch during 3.3 development, or does it exist in older versions?

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