If a log has become unreadable due to missing or corrupt data (for example, due to a drive failure, a partial offload, or some other type of corruption), the system will refuse to read that log.
You can use the “repair” functionality to generate an amendment of the original log with the corrupt data removed, allowing you to at least read through the available data.
This functionality is provided through the
ark::logging::repair_log API. You can call
this on a manifest, and an amendment will be generated (in memory) that allows you to
play back the broken manifest.
More commonly, you can use the
--repair to repair a log. For
~/ark$ ./build/ark-logtool ~/broken_logs/manifests/d2a873f7-4fa6-4733-a5c0-fc0c06039bb3 --repair Error while reading split file '02af2f18-ab1e-4e26-adb5-61245a71300a': Failed to open the split file at 02af2f18-ab1e-4e26-adb5-61245a71300a: Failed to open the file at /home/mistake/outside_logs/broken/d2a8/splits/02af2f18-ab1e-4e26-adb5-61245a71300a: No such file or directory Error while reading split file '7fe46db2-847d-455b-8bbb-3b0a39a8d3ce': Failed to open the split file at 7fe46db2-847d-455b-8bbb-3b0a39a8d3ce: Failed to open the file at /home/mistake/outside_logs/broken/d2a8/splits/7fe46db2-847d-455b-8bbb-3b0a39a8d3ce: No such file or directory Removed 2 split file(s) from the manifest. Wrote new manifest out with identifier '962f6022-d8a9-4131-9539-9b4aecbf37f9'.
You can now look at the new manifest in
~/broken_logs/manifests/962f6022-d8a9-4131-9539-9b4aecbf37f9 and you should
be able to read through the entire log (albeit with missing data).