Fixed a bug where successful write right after error recovery for last failed write finishes causes duplicate WAL entries