Skip to content

do propagation in a single query - #22648

Merged
DeepDiver1975 merged 1 commit into
masterfrom
propagate-single
Apr 25, 2016
Merged

DeepDiver1975 merged 1 commit into
masterfrom
propagate-single

Conversation

@icewind1991

Copy link
Copy Markdown
Contributor

(actually two queries but don't tell anyone that)

tricks in use

  • use sql GREATEST to only increate folder mtimes in case of a touch
  • use path_hash instead of fileid to prevent having to traverse up the filetree to get all parent ids
  • give each folder the same etag during propagation so we can do it all in one query
  • limit the size propagation with a WHERE size>-1 to prevent having to do the check for each entry

Improves upload performance anywhere from ~14% (comparison) for uploading to the root folder to over ~35% (comparison) when uploading to a deeper nested folder

cc @PVince81

@icewind1991 icewind1991 added this to the 9.0-current milestone Feb 25, 2016
@icewind1991

Copy link
Copy Markdown
Contributor Author

Fixes #18359

@karlitschek

Copy link
Copy Markdown
Contributor

very sweet!

@PVince81

Copy link
Copy Markdown
Contributor

This looks nice but I don't understand the part about "GREATEST".
It is always used, not only for touch.

Can you explain how it would behave in the case of regular propagation and touch ?

@icewind1991

Copy link
Copy Markdown
Contributor Author

This looks nice but I don't understand the part about "GREATEST".

If a folder has an mtime greater than the file being uploaded we shouldn't change the folder mtime to something lower, the GREATEST in sql replaces the need to do that max in php

@MorrisJobke

Copy link
Copy Markdown
Contributor

9.0? I would rather put this into 9.1

@PVince81

Copy link
Copy Markdown
Contributor

I agree... 9.1 or then 9.0.1 with lots of careful testing as it affects etag propagation.

@karlitschek @cmonteroluque

@MorrisJobke MorrisJobke modified the milestones: 9.1-next, 9.0-current Feb 25, 2016
@karlitschek

Copy link
Copy Markdown
Contributor

0.x releases are for critical bugfixes only. So I suggest 9.1

return $builder->expr()->literal($hash);
}, $parentHashes);

$builder->update('filecache')

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.

Please use $builder->createNamedParameter( instead of :mtime

@ghost ghost modified the milestones: 9.0-current, 9.1-next Feb 26, 2016
@ghost

ghost commented Feb 26, 2016

Copy link
Copy Markdown

related bug is a sev1 for 9.0

@karlitschek

Copy link
Copy Markdown
Contributor

@cmonteroluque I agree but this is too risky for a last minute change IMHO.

@PVince81

Copy link
Copy Markdown
Contributor

Just posted #18359 (comment) for an additional/alternative fix. Propagating etags for encryption keys doesn't make sense anyway.

@PVince81

Copy link
Copy Markdown
Contributor

As discussed with @cmonteroluque, moving this to 9.0.1

@PVince81 PVince81 modified the milestones: 9.0.1-next-maintenance, 9.0-current Feb 29, 2016
@PVince81

Copy link
Copy Markdown
Contributor

Moving to 9.1 as per original ticket.

CC @cmonteroluque

@PVince81 PVince81 modified the milestones: 9.1-current, 9.0.1-current-maintenance Mar 18, 2016
@PVince81

Copy link
Copy Markdown
Contributor

@icewind1991 please rebase and address the comments

@icewind1991
icewind1991 force-pushed the propagate-single branch 2 times, most recently from 39a0b6f to c987680 Compare April 21, 2016 11:59
@icewind1991

Copy link
Copy Markdown
Contributor Author

please rebase and address the comments

Done

@MorrisJobke

Copy link
Copy Markdown
Contributor

@PVince81 @nickvergessen @rullzer @schiesbn Please review :)

@PVince81

Copy link
Copy Markdown
Contributor

Tested with Mariadb with encryption enabled, with shares. Seems to work fine 👍

@MorrisJobke

Copy link
Copy Markdown
Contributor

Tested and works 👍

@MorrisJobke

Copy link
Copy Markdown
Contributor

Rebased to retrigger Ci

@DeepDiver1975
DeepDiver1975 merged commit f6e1b43 into master Apr 25, 2016
@DeepDiver1975
DeepDiver1975 deleted the propagate-single branch April 25, 2016 21:01
@lock

lock Bot commented Aug 6, 2019

Copy link
Copy Markdown

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 6, 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.

6 participants