Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
rgw/sfs: fail gracefully if objref not created
Browse files Browse the repository at this point in the history
It may happen if we conflict in-flight with another thread. Ensure we
just fail gracefully to the client.

Fixes: aquarist-labs/ceph#820

Signed-off-by: Joao Eduardo Luis <[email protected]>
  • Loading branch information
jecluis committed Nov 23, 2023
1 parent 1d2c6cf commit e7571be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rgw/driver/sfs/multipart.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,12 @@ int SFSMultipartUploadV2::complete(
<< dendl;
return -ERR_INTERNAL_ERROR;
}
if (!objref) {
// We were unable to create a version, but this might very well have been
// because we conflicted with another in-flight transaction. Lets return
// back to the user, and they can complete it again if they so desire.
return -ERR_INTERNAL_ERROR;
}
auto destpath = store->get_data_path() / objref->get_storage_path();
lsfs_debug(dpp
) << fmt::format("moving final object from {} to {}", objpath, destpath)
Expand Down

0 comments on commit e7571be

Please sign in to comment.