Skip to content

Only rescan versions once in trashbin - #14640

Merged
DeepDiver1975 merged 1 commit into
masterfrom
rescanversionsonlyonce
Mar 10, 2015
Merged

DeepDiver1975 merged 1 commit into
masterfrom
rescanversionsonlyonce

Conversation

@PVince81

@PVince81 PVince81 commented Mar 2, 2015

Copy link
Copy Markdown
Contributor

Whenever versions need to be rescanned, only do it once per PHP request.
Happens whenever multiple files need to be expired.

Should improve #11240

Eventually we should look into removing that scan completely once we understand why there is an potential inconsistency: #11935

@icewind1991 @schiesbn @DeepDiver1975 @nickvergessen @LukasReschke

Whenever versions need to be rescanned, only do it once per PHP request.
Happens whenever multiple files need to be expired.
@PVince81 PVince81 added this to the 8.0.2-next-maintenance milestone Mar 2, 2015
@PVince81

PVince81 commented Mar 2, 2015

Copy link
Copy Markdown
Contributor Author

I suggest to put this "quickfix" in 8.0.2 and also backport to OC 7 to improve deletion/expiration performance and solve issues where people could not delete files due to timeouts like #13176

@karlitschek

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.

im almost sure this will break tests one day 🙈

The "disable before operation and manually scan once after it" didnt work?

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.

The rescan is only triggered whenever versions need to either be expired or restored.
Here: https://github.com/owncloud/core/blob/master/apps/files_trashbin/lib/trashbin.php#L423

Basically whenever no versions folder was detected for that file (happens when expiring a file that has no versions at all) it would trigger that.

This means that rescanning might not always be needed.

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.

I'll give it a thought.

Maybe I can at least reset the flag back at the end of the restore/expire operation.

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.

I had a look and I cannot reset the flag directly in those functions.
This is because some operations like "restore()" are called in a loop from outside:
https://github.com/owncloud/core/blob/master/apps/files_trashbin/ajax/undelete.php#L48

I could reset the flag there... but it won't affect unit tests any more.

(static classes FTW...)

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 4 new issues

@ghost

ghost commented Mar 2, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/10117/
Test PASSed.

@karlitschek

Copy link
Copy Markdown
Contributor

makes sense 👍 Please backport once 8.0.1 is done

@icewind1991

Copy link
Copy Markdown
Contributor

👍 looks good

@DeepDiver1975 DeepDiver1975 modified the milestones: 8.1-current, 8.0.2-next-maintenance Mar 2, 2015
@DeepDiver1975

Copy link
Copy Markdown
Contributor

setting milestone 8.1 because merges into master

DeepDiver1975 added a commit that referenced this pull request Mar 10, 2015
Only rescan versions once in trashbin
@DeepDiver1975
DeepDiver1975 merged commit 1757d01 into master Mar 10, 2015
@DeepDiver1975
DeepDiver1975 deleted the rescanversionsonlyonce branch March 10, 2015 23:54
@PVince81

Copy link
Copy Markdown
Contributor Author

stable8: #14926

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 11, 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