Skip to content

Linking or copying consistent metadata #374

Closed

Description

@vladimir-v-diaz

A contributor reports:

When making changes, always hard linking old versions to the current will result in all previous versions (1.root, 2.root, etc) pointing to the current (root.json).

Writing the consistent version and then linking the current to that (e.g. linking root.json -> 3.root.json) should work, but requires more changes because now "write current" doesn't happen in every case. Holding two copies is a small constant increase in storage (#versions -> #versions + 1)

Either solution is fine, I left the commented code to remind myself about the issue and clearly forgot to come back to it!

We probably want to support the second solution (for clients / devices with limited space). Creating a true copy or a hard link should also probably be an option (i.e., tuf.conf.consistent_method = copy (or link)).

Activity

  1. JustinCappos commented on Oct 18, 2016

    @JustinCappos
    Member

    Did this get addressed? We discussed this a long ways back.

    On Thu, Sep 29, 2016 at 10:02 AM, Vladimir Diaz [email protected]
    wrote:

    A contributor reports:

    When making changes, always hard linking old versions to the current will
    result in all previous versions (1.root, 2.root, etc) pointing to the
    current (root.json).

    Writing the consistent version and then linking the current to that (e.g.
    linking root.json -> 3.root.json) should work, but requires more changes
    because now "write current" doesn't happen in every case. Holding two
    copies is a small constant increase in storage (#versions -> #versions + 1)

    Either solution is fine, I left the commented code to remind myself about
    the issue and clearly forgot to come back to it!

    We probably want to support the second solution (for clients / devices
    with limited space). Creating a true copy or a hard link should also
    probably be an option (i.e., tuf.conf.consistent_method = copy (or link)).

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #374, or mute the thread
    https://github.com/notifications/unsubscribe-auth/AA0XD_x61vfWtgML4aW4vUHM2P0nTkxaks5qu8TfgaJpZM4KKB0Y
    .

  2. vladimir-v-diaz commented on Oct 18, 2016

    @vladimir-v-diaz
    ContributorAuthor

    I partially implemented this here: https://github.com/vladimir-v-diaz/tuf/blob/ecordell-root-versioning/tuf/repository_lib.py#L2015-L2047. The fix points root.json to specific consistent snapshots.

    @kwang100 is working on the configurable option to either create a copy of the consistent snapshot, or a link to it.

    Consistent snapshots are now written as follows:

    [2016-10-18 17:33:53,016 UTC] [tuf.repository_lib] [INFO] [write_metadata_file:2031@repository_lib.py]
    Creating a consistent snapshot for u'/home/vlad/projects/tuf/tests/tmp6TEQkg/tmpL3SxRM/repository/metadata.staged/root.json'
    
    [2016-10-18 17:33:53,016 UTC] [tuf.repository_lib] [DEBUG] [write_metadata_file:2032@repository_lib.py]
    Saving u'/home/vlad/projects/tuf/tests/tmp6TEQkg/tmpL3SxRM/repository/metadata.staged/2.root.json'
    
    [2016-10-18 17:33:53,022 UTC] [tuf.repository_lib] [INFO] [write_metadata_file:2041@repository_lib.py]
    Pointing u'/home/vlad/projects/tuf/tests/tmp6TEQkg/tmpL3SxRM/repository/metadata.staged/root.json' to the consistent snapshot.
    
    [2016-10-18 17:33:53,023 UTC] [tuf.repository_lib] [INFO] [_write_compressed_metadata:2139@repository_lib.py]
    Saving u'/home/vlad/projects/tuf/tests/tmp6TEQkg/tmpL3SxRM/repository/metadata.staged/2.root.json.gz'
    
    [2016-10-18 17:33:53,029 UTC] [tuf.repository_lib] [INFO] [write_metadata_file:2045@repository_lib.py]
    Not creating a consistent snapshot for u'/home/vlad/projects/tuf/tests/tmp6TEQkg/tmpL3SxRM/repository/metadata.staged/snapshot.json'
    ...
  3. vladimir-v-diaz commented on Oct 26, 2016

    @vladimir-v-diaz
    ContributorAuthor

    This issue has now been fully addressed. Remaining feature (option to use either a hard link or file copy) merged in PR #385

  4. changed the title [-]Linking or copying consistent snapshots[/-] [+]Linking or copying consistent metadata[/+] on Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions