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

_migrateClone can keep on returning the same document

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.3.3
    • Fix Version/s: 3.3.4
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Sharding 12 (04/01/16)
    • 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).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kaloian.manassiev Kaloian Manassiev
              Reporter:
              renctan Randolph Tan
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: