paritytech / parity-db

Experimental blockchain database
Apache License 2.0
263 stars 59 forks source link

Limit log cleanup queue #204

Closed arkpar closed 1 year ago

arkpar commented 1 year ago

On machines with slow fsync it is possible that the log cleanup queue grows to gigabytes while fsync is in progress. This PR add a limit to the cleanup queue, pausing commits if it grows too much,

Also tweaked error handling for the log recovory. If recovery fails for reasons other than the bad log file we keep the log files around, instead of deleting them and hoping fo the best. If replay is successfull, the logs are deleted right away (after fsync), instead of waiting for the database to be closed.