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

Take submount etag into account for folder etags #20439

Merged
merged 7 commits into from
Nov 25, 2015

Conversation

icewind1991
Copy link
Contributor

This removes the need to do cross-storage etag propagation

@icewind1991
Copy link
Contributor Author

@nickvergessen can you smash this?

@nickvergessen
Copy link
Contributor

Smashed: ✅

@icewind1991
Copy link
Contributor Author

I think we can try to get this in as it is currently, there is still some optimizations we can do on top of this (remove the files_external propagation logic) but in current state it should improve the performance without regressions.

cc @PVince81

@icewind1991 icewind1991 changed the title [WIP] Take submount etag into account for folder etags Take submount etag into account for folder etags Nov 11, 2015
@icewind1991 icewind1991 added this to the 9.0-current milestone Nov 11, 2015
@PVince81
Copy link
Contributor

@icewind1991 do you mind writing a more detailed explanation of the etag propagation change as discussed last week ?

I'd also like to know what @DeepDiver1975 thinks.

While I agree that this brings a perf improvement and simplifies the etag propagation code, I'm a bit worried what happens if one user has 100+ received shared folders (mount points) and for every PROPFIND the computed etag needs to compute all of them.


namespace OC\Files\Cache;

class Propagator {
Copy link
Contributor

Choose a reason for hiding this comment

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

PHPDoc ? What does this propagator propagate and how ?

@PVince81
Copy link
Contributor

Raised #20521 to provide Webdav-based etag propagation tests, as discussed last week.

@icewind1991
Copy link
Contributor Author

While I agree that this brings a perf improvement and simplifies the etag propagation code, I'm a bit worried what happens if one user has 100+ received shared folders (mount points) and for every PROPFIND the computed etag needs to compute all of them.

Modern hardware has no problem calculating tens of thousands md5 hashes a second for strings of a few hundred characters, any overhead from the hashing will be insignificant compared to the other overhead that comes with 100+ shares/mounts

@PVince81
Copy link
Contributor

and if I understand well, the mounts are already resolved and the resolution is something we already did in the past, so there should be no performance regression there ?

@icewind1991
Copy link
Contributor Author

and if I understand well, the mounts are already resolved and the resolution is something we already did in the past, so there should be no performance regression there ?

Correct

@icewind1991
Copy link
Contributor Author

do you mind writing a more detailed explanation of the etag propagation change as discussed last week ?

Currently when propagating etags (and mtimes) we need to propagate all the way up to the root for all users who have access to the file which is complicated and expensive.

This changes it to only propagate to the root of the storage (for the owner of the file) making the etags storage in the database storage-specific etags.

When reading the etag for a folder in getFileInfo/getDirectoryContent it calculates the etag for the folder based on the "storage etag" for the folder and the etag of the root of all mounts in the folder, thus whenever a file in a mounted storage changes the etag get's propagated to the root of that storage which will change the calculated etag for the parent folders of those mounts.

@PVince81
Copy link
Contributor

Smashbox tests all passed.

@PVince81
Copy link
Contributor

I'm not sure whether we should merge it now or wait for @SergioBertolinSG's Webdav level etag propagation tests ? @DeepDiver1975 what do you think ?

On the other hand having it merged early gives an opportunity for more developer testing.

@icewind1991 should this be "To review" or is anything open ?

@icewind1991
Copy link
Contributor Author

This is good to merge in my opinion

@PVince81
Copy link
Contributor

I'm ok with this 👍

@nickvergessen
Copy link
Contributor

Currently when propagating etags (and mtimes) we need to propagate all the way up to the root for all users who have access to the file which is complicated and expensive.

The only problem with this is, that you change it from "write" to "read"? Now we need to always resolve this when reading the etag, as opposed to only when we change something, which happens way less?

@icewind1991
Copy link
Contributor Author

The only problem with this is, that you change it from "write" to "read"?

Yes, but the logic we need to do on read is simple compared to the very complex logic we had on write and the cost is neglectable

@PVince81
Copy link
Contributor

Would be good to have integration tests too #20521

@icewind1991
Copy link
Contributor Author

@nickvergessen @DeepDiver1975 can this be merged?

@icewind1991 icewind1991 force-pushed the etag-propagate-in-storage branch from 8250e3a to a95d4c2 Compare November 19, 2015 12:32
@PVince81
Copy link
Contributor

@PVince81
Copy link
Contributor

@DeepDiver1975 can we merge this ? The smashbox tests are almost ready but depend on the sync client version fix for owncloudcmd.

@nickvergessen
Copy link
Contributor

The smashbox test has been merged.

@icewind1991
Copy link
Contributor Author

@DeepDiver1975 @nickvergessen can the be merged?

@nickvergessen
Copy link
Contributor

I will smash a fresh master with this being merged in, so we can test it with all the latest magic,
but fine by me

@DeepDiver1975
Copy link
Member

👍

DeepDiver1975 added a commit that referenced this pull request Nov 25, 2015
Take submount etag into account for folder etags
@DeepDiver1975 DeepDiver1975 merged commit 50f6817 into master Nov 25, 2015
@DeepDiver1975 DeepDiver1975 deleted the etag-propagate-in-storage branch November 25, 2015 11:49
@nickvergessen
Copy link
Contributor

Smashed again and passed: ✅ 👍

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.

4 participants