Skip to content

Add option to regenerate invalid seed indexes#216

Merged
folbricht merged 2 commits intofolbricht:masterfrom
RyuzakiKK:regenerate_invalid_seed_index
Apr 3, 2022
Merged

Add option to regenerate invalid seed indexes#216
folbricht merged 2 commits intofolbricht:masterfrom
RyuzakiKK:regenerate_invalid_seed_index

Conversation

@RyuzakiKK
Copy link
Copy Markdown
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.

Comment thread fileseed.go
Comment thread sequencer.go Outdated
Comment thread assemble.go Outdated
Comment thread cmd/desync/extract.go
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
Copy Markdown
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
Copy Markdown
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
JeremieA pushed a commit to InSimo/desync that referenced this pull request Apr 10, 2026
* Add option to regenerate invalid seed indexes

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>

* Add the correct seed in the extract test

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>
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