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

Commit

Permalink
rgw/sfs: Retry delete_version_and_get_previous_transact
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Lauhoff <[email protected]>
  • Loading branch information
Marcel Lauhoff committed Nov 16, 2023
1 parent f45c7dc commit bbd7386
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/rgw/driver/sfs/sqlite/sqlite_versioned_objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ SQLiteVersionedObjects::delete_version_and_get_previous_transact(
bool SQLiteVersionedObjects::add_delete_marker_transact(
const uuid_d& object_id, const std::string& delete_marker_id, uint* out_id
) const {
try {
auto storage = conn->get_storage();
auto storage = conn->get_storage();
RetrySQLiteBusy<bool> retry([&]() {
auto transaction = storage->transaction_guard();
auto last_version_select = storage->get_all<DBVersionedObject>(
where(
Expand Down Expand Up @@ -371,12 +371,10 @@ bool SQLiteVersionedObjects::add_delete_marker_transact(
return true;
}
}
} catch (const std::system_error& e) {
// throw exception (will be caught later in the sfs logic)
// TODO revisit this when error handling is defined
throw(e);
}
return false;
return false;
});
const auto result = retry.run();
return result.has_value() ? result.value() : false;
}

std::optional<DBVersionedObject>
Expand Down

0 comments on commit bbd7386

Please sign in to comment.