Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-1826

mongorestore panic in archive mode when replay oplog failed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.9, 3.6.0-rc0
    • Fix Version/s: 100.0.0
    • Component/s: None
    • Labels:
      None

      Description

      Some known issues may cause mongorestore failed when replay oplog: SERVER-24231. In the latest versions(3.4.9 and 3.6.0-rc0) of mongorestore, it will panic with the message below if it encounters an error while replaying oplog:

      panic: send on closed channel

      I have uploaded an test archive that will help reproduce the problem. You can simply reproduce the problem using the following command:

      mongorestore --port 27017 --drop --archive=uq_idx.ar --oplogReplay --gzip

      *The root cause and how to resolve:
      *The restore goroutine encounters the applyOps error and return early, which cause the intent file's close() method being called. So readLenChan is closed in RegularCollectionReceiver.close() while the demux goroutine is still sending data on it. In the earlier version of mongorestore(3.2.11), there is another regularCollectionSender so this problem does not exist. I has a solution to fix this problem, but I don't think the patch is beautiful enough. If you are interested, we can discuss here.

        Attachments

        1. panic.patch
          3 kB
        2. uq_idx.ar
          3.12 MB

          Issue Links

            Activity

              People

              Assignee:
              david.golden David Golden
              Reporter:
              mingyan.zc@gmail.com Cen Zheng
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: