Open TomHoenderdos opened 1 year ago
It looks like CubDB
successfully locates the latest good header, but then when it tries to read the root node that the header points to, it finds it's not a valid serialized representation.
This should not be caused by a crash: CubDB
is append-only, and the transaction header is written last, so once a sane header is found, everything before it (including the root and the whole btree) must have been successfully written and committed. At a glance, it looks like file corruption of some sort. If you find a file that you can share with me (either here or privately) I will definitely investigate further. Meanwhile, if there is any reason to believe that the file system got corrupted, that could be it.
Regarding possible other causes, I assume that you did not downgrade OTP or erlang/Elixir to an earlier version, so I'd exclude a compatibility issue of the Erlang external format (also, I think it's pretty stable across releases).
If you have any other hint, do let me know. Thank you for reporting this!
Suddenly I saw CubDB had crashed this morning, this was the error returned to me. After I cleaned the cubdb files in the data_dir this error was gone. I wasn't able to download the invalid file, so I'm not giving you much to work with I'm afraid. If this happens again I will try to fetch the invalid db file and post it here.