Skip to content

Do not correct parent folders if the target isn't fully scanned #40730

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

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

jvillafanez
Copy link
Member

Description

If the folder we want to correct the size isn't fully scanned, there is no need to try to correct the parent folders: we can't get a proper size so they should stay as "need to scan" or "shallow scanned".

This should improve the performance a bit when the system isn't fully scanned, specially in deep folders, because we won't try to update all the parent folders unless it's needed.

Related Issue

https://github.com/owncloud/enterprise/issues/5605

Motivation and Context

This should reduce the DB load in some scenarios because there will be less queries to be done.

How Has This Been Tested?

  1. Prepare an external storage (SFTP for example) with "/f1/f2/f3/f4/file.txt"
  2. Connect ownCloud to the external storage
  3. Check that the "/SFTP" folder shows "pending" as size.
  4. Traverse the directories until you reach "/SFTP/f1/f2/f3/f4/file.txt"
  5. From there, traverse the directories backwards. Old "pending" sizes for the folders should show now the right size (assuming there are no additional folders you haven't traversed, such as "/SFTP/f1/f2/side_quest/")

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@update-docs
Copy link

update-docs bot commented Apr 5, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@pako81 pako81 self-requested a review July 31, 2023 14:32
@pako81
Copy link

pako81 commented Jul 31, 2023

@jvillafanez merge this?

@jvillafanez jvillafanez merged commit 279ac40 into master Aug 1, 2023
@delete-merged-branch delete-merged-branch bot deleted the improve_correctsize_in_cache branch August 1, 2023 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants