Skip to content

desync: use destination chunks as an additional seed source #312

@vigneshraman

Description

@vigneshraman

Problem description:
Desync should use the existing chunks in the destination as another source of seed. Users would like OS updates to be as small as possible when applying an update.

Desync is currently doing the following:

  • Uses the existing active partition as a seed
  • As it writes chunks to the destination, they are recorded in a so called
    "self-seed"

This means that only already encountered chunks will form the "self-seed".

Use case:
Users switching between two update branches:

Old:  [Chunk A][Chunk B][Chunk C][Chunk D]  (update branch v1)
New:  [Chunk B][Chunk A][Chunk D][Chunk C]  (update branch v2)

Desync would download all 4 chunks, even though all 4 are already on disk, but at the different positions.

We can add an option to desync extract (--destination-as-seed). Desync would start with a read pass over the destination, identify which chunks are needed but not in their expected position (B, A, D, C in this case), save them in memory, and use them during assembly.

Without --destination-as-seed:  4 chunks downloaded
With    --destination-as-seed:  0 chunks downloaded

It benefits devices that frequently switch between OS branches. Consider a device that was on branch v1, switched to v2, and is now switching back to v1. The destination partition still contains the v1 OS from the last time it was running. Most of the chunks needed are already on disk, just at different positions. Current Desync ignores this and downloads. With this change, those chunks would be identified during the pre-scan and reused directly, reducing download size.

I would like to work on this feature and wanted to check before spending time in implementation. Does the overall design seem sensible to you? Appreciate any feedback on this. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions