Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to regenerate invalid seed indexes #216

Merged
merged 2 commits into from
Apr 3, 2022

Conversation

RyuzakiKK
Copy link
Contributor

Sometimes we don't have the guarantee that a particular seed index is
always valid.
For example if a seed index is calculated and used in two different
occasions, it might happen that in the meantime some of the seed files
got corrupted or that they simply changed (if the seed is a writable
location).

One workaroud is to manually launch verify-index and then regenerate
the index if that check fails. However this involves additional steps
and is potentially slower because we need to verify the entire seed
before running the extract command.

Instead with the new option "--regenerate-invalid-seeds", Desync will
automatically regenerate the seed index if the validation step fails.

fileseed.go Show resolved Hide resolved
sequencer.go Outdated Show resolved Hide resolved
assemble.go Outdated Show resolved Hide resolved
cmd/desync/extract.go Show resolved Hide resolved
Sometimes we don't have the guarantee that a particular seed index is
always valid.
For example if a seed index is calculated and used in two different
occasions, it might happen that in the meantime some of the seed files
got corrupted or that they simply changed (if the seed is a writable
location).

One workaroud is to manually launch `verify-index` and then regenerate
the index if that check fails. However this involves additional steps
and is potentially slower because we need to verify the entire seed
before running the `extract` command.

Instead with the new option "--regenerate-invalid-seeds", Desync will
automatically regenerate the seed index if the validation step fails.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
This test usually worked because "blob2.caibx" was considered before
"blob2_corrupted.cabix". However this test was expecting to use
"blob1.caibx", but that was not the case because in `readSeedDirs()` the
index file is skipped if it is what we have set in input.

Instead, we add it explicitly to force "blob1.caibx" as a seed.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
@RyuzakiKK RyuzakiKK force-pushed the regenerate_invalid_seed_index branch from a472c91 to 741c26c Compare April 3, 2022 13:49
@RyuzakiKK
Copy link
Contributor Author

I also added the commit Add the correct seed in the extract test, because I noticed that from time to time that test was failing.

It can be moved to its own PR if you prefer.

Copy link
Owner

@folbricht folbricht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@folbricht folbricht merged commit 47914b8 into folbricht:master Apr 3, 2022
@RyuzakiKK RyuzakiKK deleted the regenerate_invalid_seed_index branch April 8, 2022 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants