Skip to content

Conditional file PUTs redownload every modified object before writing #125

Description

@revett

#119 fixed #110 by making file PUTs conditional, so a losing sync pass can no longer overwrite the winning pass's bytes. To build that ifMatch precondition, executeSyncPlan first GETs and hashes the current remote object for every push of a file that already exists remotely.

The extra GET is unavoidable given today's format: the manifest records content hashes, not ETags, so the client cannot construct an ifMatch(etag) without first fetching the object to learn its ETag (and to verify the remote hash still matches the snapshot the pass planned from). A HEAD is not enough, since the ETag alone cannot confirm the remote content is still what we planned against.

The cost is a full body download plus an additional round trip per modified file, on every pass. It roughly doubles the upload path's request count and bandwidth for updates, and it scales with both vault size and file size. For a push heavy vault this is pure overhead: the one piece of information the precondition needs, the object's ETag, is knowable at plan time but is not currently carried anywhere the pass can read it.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions