aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore/ObjectStoreStorage.php
Commit message (Collapse)AuthorAgeFilesLines
* chore: apply new CSFixer rulesFerdinand Thiessen2025-07-011-2/+2
| | | | | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> # Conflicts: # apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
* fix: remove double cache write in ObjectStoreStorage::touchRobin Appelman2025-06-181-10/+0
| | | | | | the file_put_contents already puts all of those values into the cache Signed-off-by: Robin Appelman <robin@icewind.nl>
* perf: set the folder size in the same query as we create itRobin Appelman2025-05-281-7/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix(S3): Use original folder size during copyLouis Chemineau2025-05-281-0/+4
| | | | | | | | This prevent having copied folders with a wrongly set size of 0KB. - Fix https://github.com/nextcloud/server/issues/51916 Signed-off-by: Louis Chemineau <louis@chmn.me>
* Merge pull request #51779 from nextcloud/object-store-filenameKate2025-05-061-2/+16
|\
| * feat: store original storage id and path in object store metadataobject-store-filenameRobin Appelman2025-03-311-0/+2
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * feat: more generic way of passing metadata to object storage backends for ↵Robin Appelman2025-03-311-2/+14
| | | | | | | | | | | | new objects Signed-off-by: Robin Appelman <robin@icewind.nl>
* | fix: Transfer ownership with S3 as primaryartonge/fix/transfer_ownershipLouis Chemineau2025-04-011-1/+12
|/ | | | | | | | | | | | | | | | | | | | | | When using S3 as primary storage, transferring ownership with the `--move` option fail with the following error: `SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '8-45b963397aa40d4a0063e0d85e4fe7a1' for key 'fs_storage_path_hash'` The `--move` option moves the entire home folder from one account to another. The error means that the move failed because the destination folder already exist in `oc_filecache`. - With S3 as primary storage, folders only exists as entries in `oc_filecache`. - With S3 as primary storage, `moveFromStorage(...)` only moves the cache entry, as nothing needs to be moved on disk. This cache move does not delete potentially pre-existing destination folder. - With Local storage, `moveFromStorage(...)` calls `rename(...)` which delete pre-existing folder. - `transfer(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/apps/files/lib/Service/OwnershipTransferService.php#L112 - `oneTimeUserSetup(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/SetupManager.php#L261-L262 - `mkdir(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/ObjectStore/ObjectStoreStorage.php#L91-L135 - `moveFromStorage(...)`: https://github.com/nextcloud/server/blob/687a4d9ac7fcdbd935f81a0def567a1092306f7a/lib/private/Files/ObjectStore/ObjectStoreStorage.php#L635-L636 Delete pre-existing folder in `moveFromStorage(...)` Signed-off-by: Louis Chemineau <louis@chmn.me>
* chore: cleanup leftover debug statements3-disable-multipart-remove-debugRobin Appelman2024-12-091-1/+0
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: get object size from stream where possibleRobin Appelman2024-12-051-0/+8
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* refactor(Storage): Align all Storage constructorsrefactor/storage/constructorsprovokateurin2024-10-231-11/+11
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* refactor(Storage): Make all parameter types strong typesprovokateurin2024-10-071-33/+25
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix: rework move into object store to better preserve fileidsreadd-object-store-phpunitRobin Appelman2024-09-271-19/+55
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: preserve fileid when moving from objectstore to non-objectstoreRobin Appelman2024-09-271-2/+11
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: ensure source folder is removed from cache when moving to objectstoreRobin Appelman2024-09-271-0/+1
| | | | | | otherwise this causes confusion down the line as it's contents will be moved to the new cache Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix(Storage): Fix IStorage return typesprovokateurin2024-09-261-25/+18
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* perf: reuse cache info we already have when moving to object storeobject-store-move-dbRobin Appelman2024-09-191-2/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-2/+2
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix: ensure parent folder exists when writing a file to object storageRobin Appelman2024-09-181-0/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: cleanup objectstore file_put_contentRobin Appelman2024-09-181-7/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: create intermediate directories for objectstore moveFromStorageRobin Appelman2024-09-181-0/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: get source file before moving the cache item in objectstore moveFromStorageRobin Appelman2024-09-181-1/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #47986 from cfiehe/fix_move_on_same_bucketStephan Orbaugh2024-09-171-0/+5
|\ | | | | perf(ObjectStoreStorage): Improve (slow) move on same object bucket
| * perf(ObjectStoreStorage): Improve (slow) move on same object bucketChristoph Fiehe2024-09-161-0/+5
| | | | | | | | | | | | | | | | | | This commit fixes the issue #47856. When you upload a file into a group folder and when you use a single S3 bucket as primary storage, the final move operation hangs for a long time. In the background, Nextcloud initiates a copy-delete sequence from the bucket into the bucket, with causes a lot unnecessary overhead. Nextcloud thinks that the file must be imported to another storage and does not recognize that everything is done on the same object bucket. In that case, the import step can be completely skipped, which saves time, network bandwidth and reduces the load on the object storage. The behavior improves a lot with https://github.com/nextcloud/server/pull/46013. However, there are still some put messages that are being sent to the object storage when you use an object storage as primary storage and upload files into a group folder. Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
* | fix(Storage): Fix method docs inheritancefix/storage/method-docs-inheritanceprovokateurin2024-09-171-4/+0
| | | | | | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* | chore: Fix psalm issues, put back private versions of getter in private ↵Côme Chilliet2024-09-161-0/+1
|/ | | | | | Storage interface Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #46013 from ↵Julius Härtl2024-08-261-0/+25
|\ | | | | | | | | nextcloud/obj-store-move-from-storage-preserve-fileid fix: write object to the correct urn when moving from another storage to object store
| * fix: write object to the correct urn when moving from another storage to ↵Robin Appelman2024-08-231-0/+25
| | | | | | | | | | | | object store Signed-off-by: Robin Appelman <robin@icewind.nl>
* | style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-1/+1
|/ | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* chore: Add SPDX headerAndy Scherzinger2024-05-241-27/+4
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix: Apply new coding standard to all filesCôme Chilliet2024-04-021-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Revert "don't perform an explicit setup when using the file cache"Joas Schilling2024-03-071-8/+0
|
* fix: fix user folder initRobin Appelman2024-03-061-0/+8
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: Migrate away from OC::$server->getLoggerCôme Chilliet2024-02-131-33/+54
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* refactor(objectstorage): cleanup typesThomas Citharel2024-02-021-4/+7
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* refactor(objectstorage): move $user property from ObjectStoreStorage class ↵Thomas Citharel2024-02-021-14/+3
| | | | | | to HomeObjectStoreStorage Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* fix(ObjectStore): Make copying behavior consistent with local storageFerdinand Thiessen2023-11-171-0/+7
| | | | | | Drop file permissions on copy like we do on local storage. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix: Only store unencrypted_size if path should be encryptedJulius Härtl2023-09-061-0/+2
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* use source cache when listing folder during recursive copyRobin Appelman2023-06-191-5/+6
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* don't always check if we need to setup the object store rootRobin Appelman2023-05-231-6/+18
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* repair -1 folder sizes for object store background scanRobin Appelman2023-05-101-2/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #32314 from nextcloud/object-mkdir-loggingSimon L2023-04-171-0/+3
|\ | | | | additional logging when mkdir fails for object storage
| * additional logging when mkdir fails for object storageRobin Appelman2023-04-051-0/+3
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | improve objectstore rmdir handlingRobin Appelman2023-04-031-36/+50
|/ | | | | | | | remove folder entries as they are cleared instead of in one go afterwards otherwise they stick around if some of the child entries can't be removed Signed-off-by: Robin Appelman <robin@icewind.nl>
* feat(s3): Use multipart upload for chunked uploadingJulius Härtl2023-03-081-2/+74
| | | | | | This allows to stream file chunks directly to S3 during upload. Signed-off-by: Julius Härtl <jus@bitgrid.net>
* composer run cs:fixCôme Chilliet2023-01-201-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* compare cached filesize on downloadMaxence Lange2022-12-011-2/+12
| | | Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
* allow disabling object store write checkRobin Appelman2022-10-261-1/+7
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Rename file1 and file2 to source and target in Storage abstractionCarl Schwan2022-10-181-5/+5
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Cleanup temporary files after finishing the write to object storageJulius Härtl2022-06-021-0/+2
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>