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

mongorestore hang while replaying last oplog failed in archive mode

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 100.0.0
    • 4.2.1, 4.0.13
    • mongorestore
    • None
    • v4.2

    Description

      In mongorestore archive mode with --oplogReplay option, mongorestore will hang while replaying last oplog in the archive failed. There are two goroutine stacks at the RegularCollectionReceiver.Close() func. The root cause is that the demux goroutine has readed out the archive, calling RegularCollectionReceiver.Close(), waiting on the notify of receiver.readBufChan. While the restore goroutine encounters an error while replaying oplog, also calling RegularCollectionReceiver.Close(), but waiting on the mutex of receiver.closeOnce.Do(), performing a deadlock. I have uploaded a simple patch to fix this bug, by forcing the restore goroutine read once more after error occurs. This will result in the close of the receiver.readBufChan, so that the demux goroutine can exit.

      Attachments

        Activity

          People

            david.golden@mongodb.com David Golden
            zhcn381 CenZheng
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: