borgbackup / borg

Deduplicating archiver with compression and authenticated encryption.
https://www.borgbackup.org/
Other
11.24k stars 744 forks source link

does borg check without --repair wrongly report "healed" chunks? #8533

Open ThomasWaldmann opened 1 week ago

ThomasWaldmann commented 1 week ago

borg 1.4.0

Since this is a continuation of some related testing just thought I'd note here for anyone interested some unexpected behavior from check's reporting when used without --repair following previously zeroed out chunks.

I found that after --repair had zeroed an intentionally corrupted chunk, then I ran a create backup successfully, that if I next ran check but without --repair it would report as having healed the missing chunks, when it actually hadn't.

Steps:

...
{"type": "log_message", "message": "borg-backup-test-1: home/user/Documents/test-data/test.png: Healed previously missing file chunk! (Byte 0-475076, Chunk acd0521e02a47fde43e172300e6728268517a5676ebe7079007644aff35f1dac).", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "borg-backup-test-1: home/user/Documents/test-data/test.png: Completely healed previously damaged file!", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "Analyzing archive borg-backup-test-2 (5/8)", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "borg-backup-test-2: home/user/Documents/test-data/test.png: Healed previously missing file chunk! (Byte 0-475076, Chunk acd0521e02a47fde43e172300e6728268517a5676ebe7079007644aff35f1dac).", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "borg-backup-test-2: home/user/Documents/test-data/test.png: Completely healed previously damaged file!", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "Analyzing archive borg-backup-test-3 (6/8)", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "borg-backup-test-3: home/user/Documents/test-data/test.png: Healed previously missing file chunk! (Byte 0-475076, Chunk acd0521e02a47fde43e172300e6728268517a5676ebe7079007644aff35f1dac).", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "borg-backup-test-3: home/user/Documents/test-data/test.png: Completely healed previously damaged file!", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "Analyzing archive borg-backup-test-4 (7/8)", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "borg-backup-test-4: home/user/Documents/test-data/test.png: Healed previously missing file chunk! (Byte 0-475076, Chunk acd0521e02a47fde43e172300e6728268517a5676ebe7079007644aff35f1dac).", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "borg-backup-test-4: home/user/Documents/test-data/test.png: Completely healed previously damaged file!", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "Analyzing archive borg-backup-test-5 (8/8)", "levelname": "INFO", "name": "borg.archive"}
{"type": "log_message", "message": "Archive consistency check complete, no problems found.", "levelname": "INFO", "name": "borg.archive"}

Originally posted by @chocmake in https://github.com/borgbackup/borg/discussions/8527#discussioncomment-11195598