Skip to content

Conversation

@mrow4a
Copy link
Contributor

@mrow4a mrow4a commented May 19, 2018

Description

In objectstore, each filesystem attribute needed to be retrieved using separate stat -> this implements more "filesystem" like caching of these properties.

Now, within the duration of storage->getMetadata, stat will be kept in cache and thus repetitive calls will hit stat cache instead of filecache.

Related Issue

This PR is much safer way of avoiding filecache hits then cache of filecache globally - #28166.

How Has This Been Tested?

I used diagnostic app

Old implementation - single put - files_primary_s3

{"type":"SUMMARY","reqId":"uSvspzacGpeHBg5MWWB6","time":"2018-05-19T23:22:33+00:00","remoteAddr":"::1","user":"admin","method":"PUT","url":"/octest/remote.php/dav/files/admin/testnew.txt","diagnostics":{"totalSQLQueries":176,"totalSQLDurationmsec":20.77317237854004,"totalSQLParams":405,"totalEvents":16,"totalEventsDurationmsec":61.043500900268555}}

New implementation - single put - files_primary_s3

{"type":"SUMMARY","reqId":"N3I4Dz8W75GB6yScxrCi","time":"2018-05-19T23:23:13+00:00","remoteAddr":"::1","user":"admin","method":"PUT","url":"/octest/remote.php/dav/files/admin/testnew.txt","diagnostics":{"totalSQLQueries":136,"totalSQLDurationmsec":16.56365394592285,"totalSQLParams":318,"totalEvents":16,"totalEventsDurationmsec":45.438289642333984}}

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@butonic @DeepDiver1975 @PVince81 @patrickjahns

*/
public function getMetaData($path) {
$this->statCache->enable($path);
$data = parent::getMetaData($path);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use stat cache only for the time of getMetaData call

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used by file_exists, getMimeType, filesize etc read-only functions during getMetaData call

@mrow4a mrow4a mentioned this pull request May 19, 2018
@codecov
Copy link

codecov bot commented May 20, 2018

Codecov Report

Merging #31482 into master will decrease coverage by <.01%.
The diff coverage is 52.17%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #31482      +/-   ##
============================================
- Coverage      62.6%    62.6%   -0.01%     
- Complexity    18271    18281      +10     
============================================
  Files          1147     1148       +1     
  Lines         68621    68643      +22     
  Branches       1234     1234              
============================================
+ Hits          42963    42974      +11     
- Misses        25297    25308      +11     
  Partials        361      361
Flag Coverage Δ Complexity Δ
#javascript 52.05% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 63.8% <52.17%> (-0.01%) 18281 <9> (+10)
Impacted Files Coverage Δ Complexity Δ
...b/private/Files/ObjectStore/ObjectStoreStorage.php 71.14% <50%> (-0.99%) 93 <1> (+2)
lib/private/Files/ObjectStore/StatCache.php 53.84% <53.84%> (ø) 8 <8> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 008c1ca...7da073d. Read the comment docs.

@mrow4a
Copy link
Contributor Author

mrow4a commented May 20, 2018

Better approach here -> #31486

@mrow4a mrow4a closed this May 20, 2018
@lock
Copy link

lock bot commented Jul 31, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 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.

2 participants