Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23377

_migrateClone can keep on returning the same document

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.4
    • Affects Version/s: 3.3.3
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 12 (04/01/16)
    • 0

      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).

            Assignee:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: