-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Optimize put - dont fetch metadata for part file in checksuming #27531
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
Conversation
|
Needs additional unit test or integration? As in all other PRs https://github.com/owncloud/core/pulls/mrow4a, this pops up occasionaly with reordered users , @butonic |
|
Did we merge your sorting fix ? If yes then you can rebase this. |
a00f8b8 to
5481629
Compare
| */ | ||
| public function getMetaData($path) { | ||
| $parentMetaData = $this->getWrapperStorage()->getMetaData($path); | ||
| // Check if it is partial file. Partial file metadata are only checksums |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add $parentMetaData = [] in the case we don't fetch it. I know PHP is "clever" and will make an array out thin air, but having it explicit is more readable
|
@mrow4a any update ? After making the change requested above please rebase to get more integration tests from master |
|
@PVince81 @DeepDiver1975 @jvillafanez I think this is ready :> |
|
@mrow4a seems you missed my comment ? |
|
Ohh, true, thanks! Will change |
| * | ||
| * @param string $file | ||
| * @return boolean | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have an utility method for common path checks. This isn't the first time I've seen (nor written 😞 ) this function.
I'd leave it as technical debt for now, but it should be tackled as soon as time allows it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DeepDiver1975 where will you put this utility?
| public static function isPartialFile($file) { | ||
| if (pathinfo($file, PATHINFO_EXTENSION) === 'part') { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any case for this? a/b.part/c will be consider as a part file, which I guess it's ok because a/b.part shouldn't exists in the first place, or the file is inside a "part" directory which is fine to ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, why is it important for Scanner? https://github.com/owncloud/core/blob/master/lib/private/Files/Cache/Scanner.php#L468 @PVince81 @jvillafanez
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think .part files are ignored by the scanner
64539f8 to
36675cd
Compare
|
@jvillafanez @PVince81 can we merge, I checked with DiagnosticApp and it works as desired. |
PVince81
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
@mrow4a please backport to stable10 |
|
Note: this causes an issue when uploading ".part" files directly through Webdav, see #28929 (comment) However we're not supposed to allow uploading ".part" files anyway through Webdav. The latter will be fixed in #7496 (comment). This is also for information purposes. No fix is needed for the code from this PR here. |
|
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. |

-1 query as well here