qoollo/pearl

Index regeneration on a corrupted BLOB creates an invalid index instead of returning an error

ikopylov opened this issue · 1 comments

brt shows this output on BLOB validation:

[root@bob-9 ~]# brt validate-blob -p /opt/disk9/bob/554/1685577600_8hklJQ6f0R/
[2023-06-06T12:56:39Z INFO  brt] Logger initialized
[2023-06-06T12:56:39Z INFO  brt::blob_recovery_tool::utils] Start validation
[2023-06-06T12:57:01Z WARN  brt::blob_recovery_tool::readers] Record read error, trying read next record: record header validation error: record header magic byte is invalid
[2023-06-06T12:57:01Z ERROR brt::blob_recovery_tool::utils] [/opt/disk9/bob/554/1685577600_8hklJQ6f0R/bob_8hklJQ6f0R.0.blob] validation error: record header validation error: record header magic byte is invalid
[2023-06-06T12:57:01Z INFO  brt::blob_recovery_tool::utils] 1 files validated
[2023-06-06T12:57:01Z INFO  brt::blob_recovery_tool::utils] Validation completed! 1 files validated
[2023-06-06T12:57:01Z INFO  brt::blob_recovery_tool::utils] Print corrupted blob files
/opt/disk9/bob/554/1685577600_8hklJQ6f0R/bob_8hklJQ6f0R.0.blob

This is on Bob v2.0.0

There is no correctness validation at all: https://github.com/qoollo/pearl/blob/master/src/blob/core.rs#L611
We should validate magic byte and header checksum