-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 4.2.1, 4.0.13
-
Component/s: mongorestore
-
None
-
v4.2
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.
- is depended on by
-
TOOLS-2425 Backport 'TOOLS-2403 mongorestore hang while replaying last oplog failed in archive mode'
- Closed