From 9aa3defc1fb88aee52a343d123acda3c535e5770 Mon Sep 17 00:00:00 2001 From: chunmei-liu Date: Thu, 31 Mar 2022 15:14:14 -0700 Subject: [PATCH] crimson: handle osd_op.op.flags include CEPH_OSD_OP_FLAG_FAILOK If the osd_op failed, still continue to next op when it include CEPH_OSD_OP_FLAG_FAILOK. Signed-off-by: chunmei-liu --- src/crimson/common/errorator.h | 1 + src/crimson/osd/ops_executer.cc | 13 +++++++++++++ src/crimson/osd/ops_executer.h | 3 +++ 3 files changed, 17 insertions(+) diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index b4e617ce208..f695bd82a61 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -1143,6 +1143,7 @@ namespace ct_error { using address_in_use = ct_error_code; using address_not_available = ct_error_code; using ecanceled = ct_error_code; + using einprogress = ct_error_code; struct pass_further_all { template diff --git a/src/crimson/osd/ops_executer.cc b/src/crimson/osd/ops_executer.cc index 170d091299c..81a7b50d2ce 100644 --- a/src/crimson/osd/ops_executer.cc +++ b/src/crimson/osd/ops_executer.cc @@ -475,6 +475,19 @@ OpsExecuter::call_errorator::future<> OpsExecuter::do_assert_ver( OpsExecuter::interruptible_errorated_future OpsExecuter::execute_op(OSDOp& osd_op) +{ + return (osd_op.op.flags & CEPH_OSD_OP_FLAG_FAILOK) ? + do_execute_op(osd_op).handle_error_interruptible( + crimson::ct_error::eagain::pass_further{}, + crimson::ct_error::einprogress::pass_further{}, + osd_op_errorator::all_same_way([] { + return osd_op_errorator::now(); + })) + : do_execute_op(osd_op); +} + +OpsExecuter::interruptible_errorated_future +OpsExecuter::do_execute_op(OSDOp& osd_op) { // TODO: dispatch via call table? // TODO: we might want to find a way to unify both input and output diff --git a/src/crimson/osd/ops_executer.h b/src/crimson/osd/ops_executer.h index 8e4420bb86b..659c682da3a 100644 --- a/src/crimson/osd/ops_executer.h +++ b/src/crimson/osd/ops_executer.h @@ -228,6 +228,9 @@ private: return crimson::ct_error::operation_not_supported::make(); } + interruptible_errorated_future + do_execute_op(OSDOp& osd_op); + public: template OpsExecuter(Ref pg, -- 2.39.5