Possible bug with "check -chunks -persist"

Please describe what you are doing to trigger the bug:

  1. I ran check -chunks on a storage and it tells me I have a corrupted chunk.
  2. To check the rest of the chunks I re-ran it with check -chunks -persist. This reports I have 7 corrupted chunks. However it also tells me it added all chunks as verified to the “known good” list.
  3. I now again run check -chunks and it reports no corrupted chunks.

Please describe what you expect to happen (but doesn’t):
I would expect check -chunks -persist to check all chunks and report the corrupted ones. I would then expect the good ones to be added to the “known good” list. I would expect the next run of check to still report the corrupted chunks as corrupted.

Please describe what actually happens (the wrong behaviour):
The corrupted chunks are added to the “known good” list even if they failed verification. Subsequent runs of check now incorrectly states everything is OK when it is not.

It’s not “known good chunks” list. it’s “chunks that have been checked once” list.

There is no reason to check any chunk more than once, regardless of whether the check succeeded or failed.

Hey @saspus,

Just double-checking, when a check -chunks completes with:

INFO SNAPSHOT_VERIFY All 21953 chunks have been successfully verified

It doesn’t mean all chunks were indeed valid but rather that duplicacy was able to check them, regardless of if they were corrupted or not?

EDIT:
Sorry, I’m still trying to wrap my head around this.

If verified_chunks are not “good” then why would check -chunks not add the corrupted ones to the list if -persist was not specified? I guess that’s a bug then?

EDIT2:
What I mean is that check -chunks doesn’t add the failed chunks to verified_chunks and the same chunk is re-tested every run of check.

1 Like

You are right, the inconsistent behaviour is a problem.

Both approaches (add bad chunk to verified list or not) are justifiable, depending on the meaning of the meaning of “verified chunks” – “successfully checked”, or “confirmed good”, but the behavior shall not change by the -persist flag.

@gchen?

Thanks for looking into it @saspus!

Hopefully @gchen can shed some light on which behavior was intended. :+1:

This bug has been fixed by Don't add corrupt chunks to verified_chunks · gilbertchen/duplicacy@b659456 · GitHub

1 Like

Thank you @gchen! :+1:t2: