Skip to content

[stable10] This commit adds the required server-side support for delta-sync. - #35011

Closed
PVince81 wants to merge 1 commit into
stable10from
stable10-delta-sync
Closed

[stable10] This commit adds the required server-side support for delta-sync.#35011
PVince81 wants to merge 1 commit into
stable10from
stable10-delta-sync

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

Backport of #29404 to stable10.

Should we add a config switch to disable the feature ?

The basic approach is to store zsync metadata files in a folder called
`files_zsync/` which stores them based on fileid. These metadata files
can be requested by the client via a new route
`dav/files/$user/$path?zsync`. They can also be deleted using the same
route. This is implemented using a new `ServerPlugin` called
`ZsyncPlugin`.

Filesystem hooks are used to mirror any `copy/delete` operation on the
base file or containing folders onto the metadata files. To ensure any
changes server-side changes are will not produce out-of-sync metadata.

The upload path is implemented by creating a new plugin
`ChunkingPluginZsync`. The chunk file ids are now assumed to be named
as the offsets into the original file.  Special handling is done when a
chunk named `.zsync` is found which is the generated client-side
metadata. This means copying the contents to the `files_zsync/` folder.
The core reason behind this is to ensure that both the metadata and the
file are put in place atomically, as part of the final `MOVE` request.
The implemenation adds a new class `AssemblyStreamZsync` which extends
`AssemblyStream` with additional support to fill in the data between
chunk offsets from a `backingFile`.

A new `zsync` capability is added to the dav app, which can be checked
by the client to know if delta-sync is supported or not. A zsync dav
property is also returned for files which have metadata on the server.

This commit closes #16162.
@PVince81 PVince81 added this to the backlog milestone Apr 12, 2019
@PVince81 PVince81 self-assigned this Apr 12, 2019

public function __construct(View $view) {
$this->view = $view;
$this->view->mkdir('files_zsync');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@PVince81 @DeepDiver1975 we have to find another way. This is invasive operation, and should be lazy.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note that this is a backport, not the original PR.

@mrow4a mrow4a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lets fix that mkdir issue. Lets maybe disable it by default, (informing this is experimental feature?)

@guruz

guruz commented Apr 15, 2019

Copy link
Copy Markdown
Contributor

It's already behind a [x] switch in the client, so I'd say you can keep it ON in the server since clients control if they want to use it?

@mrow4a

mrow4a commented Apr 15, 2019

Copy link
Copy Markdown
Contributor

@guruz this is exactly the problem... This mkdir is executed even when you don't use delta sync

@guruz guruz mentioned this pull request Apr 17, 2019
@guruz

guruz commented Jun 5, 2019

Copy link
Copy Markdown
Contributor

Just curious about this one :-)
As 2.6.0 will ship with delta sync

@DeepDiver1975
DeepDiver1975 deleted the stable10-delta-sync branch July 30, 2019 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants