Skip to content

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

Merged
jvillafanez merged 1 commit into
masterfrom
improve_correctsize_in_cache
Aug 1, 2023
Merged

Do not correct parent folders if the target isn't fully scanned#40730
jvillafanez merged 1 commit into
masterfrom
improve_correctsize_in_cache

Conversation

@jvillafanez

Copy link
Copy Markdown
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

update-docs Bot commented Apr 5, 2023

Copy link
Copy Markdown

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

sonarqubecloud Bot commented Apr 5, 2023

Copy link
Copy Markdown

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

pako81 commented Jul 31, 2023

Copy link
Copy Markdown

@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