Skip to content

locking for chunked dav upload - #17104

Merged
icewind1991 merged 6 commits into
masterfrom
chunked-upload-locking
Oct 27, 2015
Merged

icewind1991 merged 6 commits into
masterfrom
chunked-upload-locking

Conversation

@icewind1991

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

file_assemble emits hooks

@MorrisJobke

Copy link
Copy Markdown
Contributor

I'd rather have this in 8.2.

cc @DeepDiver1975

@DeepDiver1975

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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

understood - what is the risk?

@MorrisJobke

Copy link
Copy Markdown
Contributor

@icewind1991 Ping

@icewind1991

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 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
Copy Markdown
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
Copy Markdown
Contributor Author

8.2 is fine by me

@PVince81

PVince81 commented Jul 6, 2015

Copy link
Copy Markdown
Contributor

@PVince81

Copy link
Copy Markdown
Contributor

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

@PVince81

PVince81 commented Sep 1, 2015

Copy link
Copy Markdown
Contributor

@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
Copy Markdown

A new inspection was created.

@PVince81

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@DeepDiver1975

Copy link
Copy Markdown
Contributor

(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
Copy Markdown
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
Copy Markdown
Contributor

cc @karlitschek @cmonteroluque

@ghost

ghost commented Oct 13, 2015

Copy link
Copy Markdown

OK, moving to 9.0

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

Copy link
Copy Markdown
Contributor

yes. too risky

@PVince81

Copy link
Copy Markdown
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

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.

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

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.

Done

@icewind1991

Copy link
Copy Markdown
Contributor Author

@MorrisJobke @DeepDiver1975 can this be merged?

@MorrisJobke

Copy link
Copy Markdown
Contributor

@MorrisJobke @DeepDiver1975 can this be merged?

Letting Smashbox run against this? ;)

cc @DeepDiver1975 @nickvergessen

@nickvergessen

Copy link
Copy Markdown
Contributor

Smashed: ✅

@icewind1991

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 @MorrisJobke merge?

@MorrisJobke

Copy link
Copy Markdown
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