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

mongorestore panic in archive mode when replay oplog failed

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

      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.

        1. panic.patch
          3 kB
          CenZheng
        2. uq_idx.ar
          3.12 MB
          Cen Zheng

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

              Created:
              Updated:
              Resolved: