Skip to content

Disable part files for OC ext storage backend + s2s backend - #13160

Merged
MorrisJobke merged 2 commits into
masterfrom
extstorage-ocbackendnopartfile
Jan 16, 2015
Merged

MorrisJobke merged 2 commits into
masterfrom
extstorage-ocbackendnopartfile

Conversation

@PVince81

@PVince81 PVince81 commented Jan 7, 2015

Copy link
Copy Markdown
Contributor

When uploading files to an OC ext storage backend or when using server
to server sharing storage, part files aren't needed because the backend
already has its own part files and takes care of the final atomic rename
operation.

This also fixes issues when using two encrypted ownCloud instances where
one mounts the other either as external storage (ownCloud backend) or
through server to server sharing.

Note: this is a quick fix for now. In the future we'll look into providing a method on the Storage class and/or having storage specific storage attributes/chunk handlers that would let the storage class decide whether or not part files/chunks/whatever is required or not.

Please review @schiesbn @icewind1991 @DeepDiver1975

Fixes #13157 and #5952
To test: setup two ownCloud instances with BOTH having encryption enabled.

Server to server sharing

Mount OC B in OC A.
Setup sync client for OC A.

  • upload small file (no chunking)
  • upload big file (chunking)

External storage backend "ownCloud"

Mount OC B in OC A.
Setup sync client for OC A.

  • upload small file (no chunking)
  • upload big file (chunking)

Regression testing

Uploading to regular storage or another one (ex: SFTP):

  • upload small file (no chunking)
  • upload big file (chunking)

I tested this and it worked.

When uploading files to an OC ext storage backend or when using server
to server sharing storage, part files aren't needed because the backend
already has its own part files and takes care of the final atomic rename
operation.

This also fixes issues when using two encrypted ownCloud instances where
one mounts the other either as external storage (ownCloud backend) or
through server to server sharing.
Comment thread lib/private/connector/sabre/file.php Outdated

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.

Is $internalPath actually needed here for anything except eating memory? - I doubt it, remove it?

@DeepDiver1975 DeepDiver1975 added this to the 8.0-current milestone Jan 8, 2015
@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 3 new issues, 1 updated code elements

@ghost

ghost commented Jan 8, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/6027/
👍 Test PASSed. 👍

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.

Enforce type?

private function needsPartFile(\OCP\Files\Storage $storage) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I considered it, but was a bit afraid what happens if by any chance there's a storage that doesn't implement this interface. Not sure why I thought that. Just wanted to be safe and not risk breaking additional stuff.

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.

Mhm – generally speaking a type annotation in the PHPDoc is worth nothing when not enforced as well :-)

But go whatever you feel safer here :-)

@PVince81

Copy link
Copy Markdown
Contributor Author

Anything else to change ?

@DeepDiver1975

Copy link
Copy Markdown
Contributor

looks good from my pov 👍

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Fixes #13157 and #5952

#5952 is scheduled for 8.1 - we shall move it to 8.0 I assume?

@PVince81

Copy link
Copy Markdown
Contributor Author

Yes. We set it to 8.1 back then because the scope of the fix wasn't clear.

@PVince81

Copy link
Copy Markdown
Contributor Author

@MorrisJobke @LukasReschke @icewind1991 can we merge this ?

@MorrisJobke

Copy link
Copy Markdown
Contributor

I will review this one.

@MorrisJobke

Copy link
Copy Markdown
Contributor

Tested with small (text file) and big 700 MB video. Both work after the fix (via web UI and sync client)

@MorrisJobke

Copy link
Copy Markdown
Contributor

👍

MorrisJobke added a commit that referenced this pull request Jan 16, 2015
Disable part files for OC ext storage backend + s2s backend
@MorrisJobke
MorrisJobke merged commit 0f0204e into master Jan 16, 2015
@MorrisJobke
MorrisJobke deleted the extstorage-ocbackendnopartfile branch January 16, 2015 12:39
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server two server sharing + sync client + encryption on both sides fails

5 participants