Skip to content

Commit

Permalink
Merge pull request ceph#59815 from athanatos/sjust/wip-68068
Browse files Browse the repository at this point in the history
crimson: don't retain InternalClientRequest on interval change even if primary does not change

Reviewed-by: Matan Breizman <[email protected]>
Reviewed-by: Xuehan Xu <[email protected]>
  • Loading branch information
athanatos authored Sep 30, 2024
2 parents e89b0ff + 8473809 commit 748842a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 41 deletions.
26 changes: 0 additions & 26 deletions src/crimson/osd/osd_operations/client_request_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,30 +71,4 @@ CommonClientRequest::do_recover_missing(
}
}

bool CommonClientRequest::should_abort_request(
const Operation& op,
std::exception_ptr eptr)
{
if (*eptr.__cxa_exception_type() ==
typeid(::crimson::common::actingset_changed)) {
try {
std::rethrow_exception(eptr);
} catch(::crimson::common::actingset_changed& e) {
if (e.is_primary()) {
logger().debug("{} {} operation restart, acting set changed", __func__, op);
return false;
} else {
logger().debug("{} {} operation abort, up primary changed", __func__, op);
return true;
}
}
} else {
assert(*eptr.__cxa_exception_type() ==
typeid(crimson::common::system_shutdown_exception));
crimson::get_logger(ceph_subsys_osd).debug(
"{} {} operation skipped, system shutdown", __func__, op);
return true;
}
}

} // namespace crimson::osd
3 changes: 0 additions & 3 deletions src/crimson/osd/osd_operations/client_request_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ struct CommonClientRequest {
Ref<PG> pg,
const hobject_t& soid,
const osd_reqid_t& reqid);

static bool should_abort_request(
const crimson::Operation& op, std::exception_ptr eptr);
};

} // namespace crimson::osd
19 changes: 7 additions & 12 deletions src/crimson/osd/osd_operations/internal_client_request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ seastar::future<> InternalClientRequest::start()
{
track_event<StartEvent>();
return crimson::common::handle_system_shutdown([this] {
return seastar::repeat([this] {
LOG_PREFIX(InternalClientRequest::start);
DEBUGI("{}: in repeat", *this);

return interruptor::with_interruption([this]() mutable {
return enter_stage<interruptor>(
client_pp().wait_for_active
Expand Down Expand Up @@ -121,17 +121,12 @@ seastar::future<> InternalClientRequest::start()
PG::load_obc_ertr::all_same_way([] {
return seastar::now();
})
).then_interruptible([] {
return seastar::stop_iteration::yes;
});
}, [this](std::exception_ptr eptr) {
if (should_abort_request(*this, std::move(eptr))) {
return seastar::stop_iteration::yes;
} else {
return seastar::stop_iteration::no;
}
}, pg, start_epoch);
}).then([this] {
);
}, [](std::exception_ptr eptr) {
return seastar::now();
}, pg, start_epoch

).then([this] {
track_event<CompletionEvent>();
}).handle_exception_type([](std::system_error &error) {
logger().debug("error {}, message: {}", error.code(), error.what());
Expand Down

0 comments on commit 748842a

Please sign in to comment.