Skip to content
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

fix: write object to the correct urn when moving from another storage to object store #46013

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

icewind1991
Copy link
Member

The default copyFromStorage + delete approach loads to the object being written to the wrong urn.

See also #43660 for a description of the problem and alternate approach.

@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Jun 20, 2024
@icewind1991 icewind1991 added this to the Nextcloud 30 milestone Jun 20, 2024
@icewind1991 icewind1991 requested review from a team, ArtificialOwl, yemkareems and sorbaugh and removed request for a team June 20, 2024 14:02
@icewind1991 icewind1991 force-pushed the obj-store-move-from-storage-preserve-fileid branch from 28c3f45 to 23c72c0 Compare June 20, 2024 16:53
@icewind1991 icewind1991 requested a review from come-nc June 21, 2024 08:42
… to object store

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 force-pushed the obj-store-move-from-storage-preserve-fileid branch from 23c72c0 to ae77cde Compare June 21, 2024 08:42
try {
$this->writeStream($targetInternalPath, $sourceStorage->fopen($sourceInternalPath, 'r'), $sourceCacheEntry->getSize());
} catch (\Exception $e) {
$this->getCache()->remove($targetInternalPath);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also put back the file in the source cache on exceptions?
Here it’s lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants