Commit graph

156 commits

Author SHA1 Message Date
Carl Schwan
7100c71166
perf(metadata): Add optimized sharding for metadata deletion
Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-28 17:18:33 +01:00
Carl Schwan
fd3878448b
feat(filecache): Scale DB query created when deleting file from filecache
Instead of creating a CacheEntryRemovedEvent for each deleted files,
create a single CacheEntriesRemovedEvent which wrap multiple
CacheEntryRemovedEvent.

This allow listener to optimize the query they do when multiple files
are deleted at the same time (e.g. when deleting a folder).

Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
2026-01-28 16:07:57 +01:00
Carl Schwan
dd26a8b7eb
fix(cache): Fix parsing cache entry from groupfolder and collectives
Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-23 10:52:44 +01:00
Robin Appelman
a79bf069a3 fix: dont error on missing path_hash/checksum cacheentry fields
Signed-off-by: Robin Appelman <robin@icewind.nl>
2026-01-15 18:02:41 +01:00
Carl Schwan
06827970a8
fix(cache): Handle groupfolder specific entries in cacheEntryFromData
Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-15 11:47:59 +01:00
Carl Schwan
0b8eae7789
perf(files): Optimize CacheEntry creation
Avoid many copy on writes and create array only once.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-15 11:47:41 +01:00
Benjamin Frueh
989b75ee43 fix: Clear mount cache when file storage changes during move
Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>
2025-11-20 09:15:28 +01:00
provokateurin
ef279f6049
fix(files): Stop overwriting scan_permissions
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-09-28 14:11:47 +02:00
Côme Chilliet
12532bb535
fix(encryption): Correctly set encrypted to 0 when copying
If encryption got disabled, copying should set encrypted to 0 for the
 new unencrypted copy. For instance when using encryption:decrypt-all

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-09-09 11:46:18 +02:00
Carl Schwan
c4e6fbdae7 fix(query-builder): Don't catch UniqueConstraintViolationException
UniqueConstraintViolationException is no longer throw directly but
instead is now wrapped inside a \OCP\DB\Exception. So check the
exception reason.

Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
2025-09-02 11:55:58 +02:00
Carl Schwan
c21b8169ff refactor(querybuilder): Port away from qb::execute() in lib/
Replace by either executeStatement or executeQuery

Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
2025-09-02 11:55:56 +02:00
Robin Appelman
1a716578fd
fix: fix moving cache items from cache jail with sharding
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-08-22 19:21:31 +02:00
Ferdinand Thiessen
5981b7eb51
chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +02:00
Robin Appelman
5329c373cc fix: improve error message when cache rename source can't be found
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-05-15 15:06:55 +02:00
Benjamin Gaussorgues
9bdee76535
perf(files): faster query to fetch incomplete directories
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2025-02-13 10:11:02 +01:00
Ferdinand Thiessen
b48ee2e924
fix: Harden files scanner for invalid null access
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-01-28 20:08:46 +01:00
Robin Appelman
6419de7acc fix: use scan_permissions when copying cache items
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-12-04 19:19:08 +01:00
Robin Appelman
88c685f27c fix: store unmaked source permissions as scan_permissions when loading share cache items
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-12-04 19:19:08 +01:00
Louis Chemineau
f9cda54cbf
fix: Wrap partial cache entry in CacheEntry
Because it is returned here: 7b7d07c575/lib/private/Files/Cache/Cache.php (L136-L137)

And some implementation got stricter: df95bf6ba8/lib/Mount/RootEntryCache.php (L23-L28)

Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-11-21 17:13:24 +01:00
dependabot[bot]
bb598c8451
chore(deps): Bump nextcloud/coding-standard in /vendor-bin/cs-fixer
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v1.3.1...v1.3.2)

---
updated-dependencies:
- dependency-name: nextcloud/coding-standard
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-19 07:57:35 +02:00
Git'Fellow
a1681b0756 chore(db): Apply query prepared statements
Fix: psalm

fix: bad file

fix: bug

chore: add batch

chore: add batch

chore: add batch

fix: psalm
2024-10-17 20:30:47 +02:00
Ferdinand Thiessen
a8f46af20f
chore: Add proper deprecation dates where missing
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-20 00:46:03 +02:00
Robin Appelman
75cf17e4c4 fix: verify that parent exists in cache when inserting
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-18 14:11:27 +02:00
John Molakvoæ
ff0cab5956
Merge pull request #47852 from nextcloud/sharding-code-fixes 2024-09-16 11:39:58 +02:00
provokateurin
714671a8a6
fix(files): Adjust Cache::searchQuery() parameter name to match interface
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-13 18:13:44 +02:00
Robin Appelman
da59fd4389
fix: misc code fixes around db sharding
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-09 16:59:59 +02:00
Louis Chemineau
2574cbfa61
chore: Apply php:cs recommendations
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-08-28 10:44:18 +02:00
Robin Appelman
390f6a78b4
fix: hint storage id in more places
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 10:21:19 +02:00
Robin Appelman
62f8b6517f
feat: implement distributing partitioned queries over multiple shards
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 10:21:19 +02:00
Daniel Kesselberg
af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02:00
Robin Appelman
80f8c7949e
fix: always set storage id in Cache::get
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-07-17 15:46:31 +02:00
Robin Appelman
5ff7bde3fb
fix: add set storage id for more cache queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-07-17 15:46:21 +02:00
Robin Appelman
c82d382a20 feat: add base class for extending the query builder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-07-12 17:01:39 +02:00
Robin Appelman
082c6c6e1d
fix: get child ids for folder in a separate query during move
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-06-13 10:38:57 +02:00
Louis Chemineau
a93d3a5a10 fix(files): Use isRetryable to catch retryable exceptions
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-06-11 15:15:14 +02:00
Andy Scherzinger
dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00
Christoph Wurst
f3d6309e36
perf(db): Sort data for IN before chunking
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-04-26 15:38:29 +02:00
Maxence Lange
b4004a2582
Merge pull request #43574 from nextcloud/enh/noid/lazyappconfig-migrate-metadata
enh(metadata): migrate metadata to lazy appconfig
2024-04-17 16:20:33 -01:00
Côme Chilliet
ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +02:00
Louis Chemineau
751795999a
feat(files)): Add retry logic to cover deadlock situations when moving many files
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-03-28 09:05:47 +01:00
Git'Fellow
575159b819
fix(filecache): Move from array_merge to avoid memory exhaustion
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2024-03-04 18:13:45 +01:00
Maxence Lange
4e1814acd1 migrate metadata to lazy appconfig
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-02-14 13:30:27 -01:00
Robin Appelman
7a91abb439 improve di performance for cache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-02-09 13:28:30 +01:00
Git'Fellow
394cd75322
Merge pull request #41272 from nextcloud/fixOccScans
fix: reduce memory consumption of scans
2023-11-28 11:36:59 +01:00
Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +01:00
Christoph Wurst
ea8f9a7e84 refactor: Repalce array_search with in_array in lib/
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-11-22 11:42:53 +01:00
Maxence Lange
3af12b2a50 ignore metadata if table is empty
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2023-11-14 09:28:58 -01:00
Louis Chemineau
d3a313f192
Support getting and setting metadata in DAV requests
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-11-08 16:23:53 +01:00
Git'Fellow
b4a3773115 fix: reduce memory consumption of scans
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

Fix lint

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2023-11-03 18:07:42 +01:00
Ferdinand Thiessen
9c04c07622 fix: Prevent PHP warnings when optional CacheEntry attributes are unset
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2023-08-16 14:12:51 +02:00