Skip to content

Conversation

@PVince81
Copy link
Contributor

Description

Store new dav chunks directly instead of going through File::put() which
would run all hooks. Hooks are now only triggered at the end of the
transfer when the future file is moved to the final file, in which case
the assemble data goes through File::put() and triggers the hooks.

Note: this likely doesn't solve the problem for storage wrappers. For storage wrappers, these need to verify whether the target path is outside of "files" and bypass operation in such cases. Not part of this PR, needs to be implemented in every storage wrapper.

Related Issue

https://github.com/owncloud/enterprise/issues/2229

Motivation and Context

Prevent hooks to be fired for every chunk.

How Has This Been Tested?

Upload 100 MB file in web UI.

Before this fix: oc_activity polluted with extra entries for each chunk
After this fix: oc_activity only

Also works with encryption.

Can someone test this with object store ? @DeepDiver1975 @SergioBertolinSG

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@PVince81 PVince81 added this to the development milestone Aug 24, 2017
@PVince81 PVince81 added the p1-urgent Critical issue, need to consider hotfix with just that issue label Aug 24, 2017
@PVince81
Copy link
Contributor Author

I've set this to p1 because triggering hooks for every chunk is likely to cause unwanted and undiscovered side effects.

@DeepDiver1975
Copy link
Member

checksums are not properly computed now?

bildschirmfoto von 2017-08-25 09-07-41

@PVince81
Copy link
Contributor Author

@DeepDiver1975 I need to look into this. Some tests were expecting checksums for every chunks and need to be adjusted.

@PVince81
Copy link
Contributor Author

apparently there isn't even a test for new dav final move with checksum, I'll add one

@PVince81
Copy link
Contributor Author

@DeepDiver1975 tests adjusted, see f09c06c

@PVince81
Copy link
Contributor Author

@owncloud/qa can you guys test this with objectstore ? I expect uploaded chunks to be stored in object store by default and should still work .

Vincent Petry added 2 commits August 25, 2017 16:54
Store new dav chunks directly instead of going through File::put() which
would run all hooks. Hooks are now only triggered at the end of the
transfer when the future file is moved to the final file, in which case
the assemble data goes through File::put() and triggers the hooks.
Don't send checksums for each chunk but for the final move.
Added test for the final move.
Removed test code for chunk checksum.
@PVince81 PVince81 force-pushed the newdav-directchunk branch from f09c06c to eef29c1 Compare August 25, 2017 14:56
@PVince81
Copy link
Contributor Author

PVince81 commented Aug 25, 2017

@PVince81 Who is finle? :)

who are you talking about ? never heard of such person 🕴 🕶

return $mtime;
}

public function getView() {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if we should expose this. Taking into account that we only need one method of the view, we can wrap that method we need inside a specific method in the node. This way we don't need to expose the underlying view object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean creating a method putDirectly($path, $data) and call that from outside ?

Copy link
Member

Choose a reason for hiding this comment

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

yes, that's what I mean,

@PVince81
Copy link
Contributor Author

@jvillafanez 44e72ac

@PVince81
Copy link
Contributor Author

stable10: #28817

@PVince81 PVince81 self-assigned this Aug 28, 2017
@PVince81 PVince81 merged commit fb43344 into master Aug 28, 2017
@PVince81 PVince81 deleted the newdav-directchunk branch August 28, 2017 13:55
// TODO: verify name - should be a simple number
$this->node->createFile($name, $data);
// need to bypass hooks for individual chunks
$this->node->createFileDirectly($name, $data);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the firewall is using hooks then those aren't triggered any more.

@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

4 - To release p1-urgent Critical issue, need to consider hotfix with just that issue status/STALE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants