tidwall / buntdb

BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support
MIT License
4.57k stars 289 forks source link

Cannot load truncated AOF files. #71

Closed edwinhayes closed 3 years ago

edwinhayes commented 3 years ago

If the AOF file is truncated such that the last entry is malformed, then readLoad() fails to load the entire file, making it impossible to recover the valid transactions other than the last still present in the file without manual intervention.

It would be preferable if either readLoad() just ignored the invalid tail of the file, or another function was provided to recover the file by making a truncated copy.

tidwall commented 3 years ago

Possible related issues: https://github.com/tidwall/tile38/issues/593 https://github.com/tidwall/tile38/issues/600

tidwall commented 3 years ago

I pushed a new version that addresses this issue.