Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locking for chunked dav upload #17104

Merged
merged 6 commits into from
Oct 27, 2015
Merged

locking for chunked dav upload #17104

merged 6 commits into from
Oct 27, 2015

Conversation

icewind1991
Copy link
Contributor

Change the locking handler code to work directly on the storage and lock the upload target while we're assembling the chunks.

cc @DeepDiver1975 @PVince81

@DeepDiver1975 DeepDiver1975 added this to the 8.1-current milestone Jun 23, 2015
@PVince81
Copy link
Contributor

Dangerous change that late in the release, it does not only affect locking.

It seems you aren't firing any hooks ?

I'd rather have this in 8.2.

Locking already works with chunking, it just doesn't wrap everything in a bigger transaction yet. This could be done in 8.2 instead.

@icewind1991
Copy link
Contributor Author

file_assemble emits hooks

@MorrisJobke
Copy link
Contributor

I'd rather have this in 8.2.

cc @DeepDiver1975

@DeepDiver1975
Copy link
Member

Locking already works with chunking, it just doesn't wrap everything in a bigger transaction yet. This could be done in 8.2 instead.

With and without this change the whole assembly process (which is the one which eats time) is locked - so I guess this is not a critical/required change.

@icewind1991 do I miss anything?

What we need is a locking mechanism for the whole chunked upload procedure?
But this is something we can keep for 8.2.

@icewind1991
Copy link
Contributor Author

Without this change the assembly itself is locked but only on the part file path and the other related operations (cache updates, touch, etc) are not locked.

@DeepDiver1975
Copy link
Member

and the other related operations (cache updates, touch, etc) are not locked.

understood - what is the risk?

@MorrisJobke
Copy link
Contributor

@icewind1991 Ping

@icewind1991
Copy link
Contributor Author

I don't think the risk is high, in most cases the only risk is between assembling the file in a .part and renaming it to the final target

@PVince81
Copy link
Contributor

When I asked about risk, I was talking about risk of regression.
Anyway, this will need retesting chunked upload which can hopefully be done by smashbox.

@PVince81
Copy link
Contributor

The following things need to be tested:

  • TEST: chunk upload still works
  • TEST: chunk upload when file is already locked: should fail with 423 Locked
  • TEST: other process accesses file while chunk upload locked file: fail with 423 Locked
  • TEST: pre-hooks called (versions app?)
  • TEST: post-hooks called (versions app?

@PVince81
Copy link
Contributor

Also missing:

  • TODO: add unit test to check for locks in pre and post hooks

Last week I already added tests for the non-chunking case, hopefully these can be reused.

@DeepDiver1975
Copy link
Member

When I asked about risk, I was talking about risk of regression.
Anyway, this will need retesting chunked upload which can hopefully be done by smashbox.

@PVince81 sure - but my question was explicit on the risk of NOT having this change in.

As the risk is not that high I tend to move this to 8.2.

@PVince81 agree?
@icewind1991 agree?

THX

@PVince81
Copy link
Contributor

Yes, let's make this 8.2.
We still already have enough other issues to attend to for 8.1

@DeepDiver1975 DeepDiver1975 modified the milestones: 8.2-next, 8.1-current Jun 26, 2015
@icewind1991
Copy link
Contributor Author

8.2 is fine by me

@PVince81
Copy link
Contributor

PVince81 commented Jul 6, 2015

@icewind1991 please rebase and add unit tests.
Have a look how I did it https://github.com/owncloud/core/blob/master/tests/lib/connector/sabre/file.php#L305 for single file upload.

@PVince81
Copy link
Contributor

Please make sure folder size propagation still works, see #18006

@PVince81
Copy link
Contributor

PVince81 commented Sep 1, 2015

@icewind1991 did you try reproducing the issue ?

@icewind1991 icewind1991 force-pushed the chunked-upload-locking branch from dc5b825 to faa59c0 Compare September 14, 2015 12:49
@scrutinizer-notifier
Copy link

A new inspection was created.

@PVince81
Copy link
Contributor

Had a quick test with the sync client to verify that chunk uploads are still creating versions. This confirms that hooks are fired properly.

👍

@PVince81
Copy link
Contributor

(not too happy to have such huge change that late, but fine)

@DeepDiver1975
Copy link
Member

(not too happy to have such huge change that late, but fine)

You are right - there is no real need for this (as in fixes sev1 or sev2)

8.2.1 or 9.0 ?

@MorrisJobke
Copy link
Contributor

8.2.1 or 9.0 ?

I would say 9.0, because backporting such stuff in a point release is really tricky and can go horribly wrong. Having this in early 9.0 will be much better.

@MorrisJobke
Copy link
Contributor

cc @karlitschek @cmonteroluque

@ghost
Copy link

ghost commented Oct 13, 2015

OK, moving to 9.0

@ghost ghost modified the milestones: 9.0-next, 8.2-current Oct 13, 2015
@karlitschek
Copy link
Contributor

yes. too risky

@PVince81
Copy link
Contributor

Needs a second reviewer @nickvergessen @DeepDiver1975

@icewind1991 icewind1991 force-pushed the chunked-upload-locking branch from ebcdccf to 283798a Compare October 20, 2015 12:16
@@ -43,6 +45,34 @@ public function testUploadOverWrite() {
$this->assertEquals(3, $info->getSize());
}

/**
* @expectedException \OC\Connector\Sabre\Exception\FileLocked
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this needs to be adjusted to the new location inside apps/dav

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@icewind1991
Copy link
Contributor Author

@MorrisJobke @DeepDiver1975 can this be merged?

@MorrisJobke
Copy link
Contributor

@MorrisJobke @DeepDiver1975 can this be merged?

Letting Smashbox run against this? ;)

cc @DeepDiver1975 @nickvergessen

@nickvergessen
Copy link
Contributor

Smashed: ✅

@icewind1991
Copy link
Contributor Author

@DeepDiver1975 @MorrisJobke merge?

@MorrisJobke
Copy link
Contributor

I also did some tests with cadaver as 3rdparty client. Everything still works 👍

icewind1991 added a commit that referenced this pull request Oct 27, 2015
@icewind1991 icewind1991 merged commit c309193 into master Oct 27, 2015
@icewind1991 icewind1991 deleted the chunked-upload-locking branch October 27, 2015 15:58
@icewind1991 icewind1991 mentioned this pull request Mar 22, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Aug 9, 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.

7 participants