summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRadoslaw Zarzynski <rzarzyns@redhat.com>2022-12-11 17:38:38 +0100
committerRadoslaw Zarzynski <rzarzyns@redhat.com>2023-02-28 17:22:05 +0100
commit912a940f461cb771a5e62a3a3ffea98a168329de (patch)
tree4e04fab03f3b2fd809c1fb63c22040229cadcff8 /src
parentcrimson/osd: dissect snapset update into SnapTrimObjSubEvent::update_head() (diff)
downloadceph-912a940f461cb771a5e62a3a3ffea98a168329de.tar.xz
ceph-912a940f461cb771a5e62a3a3ffea98a168329de.zip
crimson/osd: convert SnapTrimObjSubEvent::remove_or_update to ertr
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/crimson/osd/osd_operations/snaptrim_event.cc9
-rw-r--r--src/crimson/osd/osd_operations/snaptrim_event.h7
2 files changed, 12 insertions, 4 deletions
diff --git a/src/crimson/osd/osd_operations/snaptrim_event.cc b/src/crimson/osd/osd_operations/snaptrim_event.cc
index ccccda5d185..3a68935ab4d 100644
--- a/src/crimson/osd/osd_operations/snaptrim_event.cc
+++ b/src/crimson/osd/osd_operations/snaptrim_event.cc
@@ -402,7 +402,7 @@ void SnapTrimObjSubEvent::update_head(
attrs);
}
-SnapTrimObjSubEvent::interruptible_future<
+SnapTrimObjSubEvent::remove_or_update_iertr::future<
SnapTrimObjSubEvent::remove_or_update_ret_t>
SnapTrimObjSubEvent::remove_or_update(
ObjectContextRef obc,
@@ -412,15 +412,18 @@ SnapTrimObjSubEvent::remove_or_update(
if (citer == obc->ssc->snapset.clone_snaps.end()) {
logger().error("{}: No clone_snaps in snapset {} for object {}",
*this, obc->ssc->snapset, coid);
+ return crimson::ct_error::enoent::make();
}
const auto& old_snaps = citer->second;
if (old_snaps.empty()) {
logger().error("{}: no object info snaps for object {}",
*this, coid);
+ return crimson::ct_error::enoent::make();
}
if (obc->ssc->snapset.seq == 0) {
logger().error("{}: no snapset.seq for object {}",
*this, coid);
+ return crimson::ct_error::enoent::make();
}
const OSDMapRef& osdmap = pg->get_osdmap();
std::set<snapid_t> new_snaps;
@@ -507,8 +510,8 @@ seastar::future<> SnapTrimObjSubEvent::with_pg(
logger().debug("{}: processing clone_obc={}", *this, clone_obc);
return remove_or_update(
clone_obc, clone_obc->head
- ).then_unpack_interruptible([clone_obc, this]
- (auto&& txn, auto&& log_entries) mutable {
+ ).safe_then_unpack_interruptible([clone_obc, this]
+ (auto&& txn, auto&& log_entries) mutable {
auto [submitted, all_completed] = pg->submit_transaction(
std::move(clone_obc),
std::move(txn),
diff --git a/src/crimson/osd/osd_operations/snaptrim_event.h b/src/crimson/osd/osd_operations/snaptrim_event.h
index 408f529b788..c3bbe1a6d5e 100644
--- a/src/crimson/osd/osd_operations/snaptrim_event.h
+++ b/src/crimson/osd/osd_operations/snaptrim_event.h
@@ -149,9 +149,14 @@ private:
ceph::os::Transaction& txn,
std::vector<pg_log_entry_t>& log_entries);
+ using remove_or_update_ertr =
+ crimson::errorator<crimson::ct_error::enoent>;
+ using remove_or_update_iertr =
+ crimson::interruptible::interruptible_errorator<
+ IOInterruptCondition, remove_or_update_ertr>;
using remove_or_update_ret_t =
std::pair<ceph::os::Transaction, std::vector<pg_log_entry_t>>;
- interruptible_future<remove_or_update_ret_t>
+ remove_or_update_iertr::future<remove_or_update_ret_t>
remove_or_update(ObjectContextRef obc, ObjectContextRef head_obc);
// we don't need to synchronize with other instances started by