Skip to content

Commit

Permalink
Merge pull request ceph#56025 from xxhdx1985126/wip-seastore-onode-lo…
Browse files Browse the repository at this point in the history
…c-key

crimson/osd/osd_operations/client_requests: we don't support rados locator keys

Reviewed-by: Samuel Just <[email protected]>
Reviewed-by: chunmei-liu <[email protected]>
Reviewed-by: Yingxin Cheng <[email protected]>
Reviewed-by: Matan Breizman <[email protected]>
  • Loading branch information
Matan-B authored Apr 21, 2024
2 parents 5504baf + 776c2b3 commit 226cba1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
43 changes: 26 additions & 17 deletions src/crimson/osd/osd_operations/client_request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,23 @@ bool ClientRequest::is_pg_op() const
[](auto& op) { return ceph_osd_op_type_pg(op.op.op); });
}

ClientRequest::interruptible_future<>
ClientRequest::reply_op_error(const Ref<PG>& pg, int err)
{
LOG_PREFIX(ClientRequest::reply_op_error);
DEBUGDPP("{}: replying with error {}", *pg, *this, err);
auto reply = crimson::make_message<MOSDOpReply>(
m.get(), err, pg->get_osdmap_epoch(),
m->get_flags() & (CEPH_OSD_FLAG_ACK|CEPH_OSD_FLAG_ONDISK),
!m->has_flag(CEPH_OSD_FLAG_RETURNVEC));
reply->set_reply_versions(eversion_t(), 0);
reply->set_op_returns(std::vector<pg_log_op_return_item_t>{});
// TODO: gate the crosscore sending
return interruptor::make_interruptible(
get_foreign_connection().send_with_throttling(std::move(reply))
);
}

ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptible(
Ref<PG> pgref, const unsigned this_instance_id, instance_handle_t &ihref)
{
Expand All @@ -109,6 +126,15 @@ ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptib

DEBUGDPP("{} start", *pgref, *this);
PG &pg = *pgref;
if (!m->get_hobj().get_key().empty()) {
// There are no users of locator. It was used to ensure that multipart-upload
// parts would end up in the same PG so that they could be clone_range'd into
// the same object via librados, but that's not how multipart upload works
// anymore and we no longer support clone_range via librados.
get_handle().exit();
co_await reply_op_error(pgref, -ENOTSUP);
co_return;
}
if (pg.can_discard_op(*m)) {
co_await interruptor::make_interruptible(
shard_services->send_incremental_map(
Expand Down Expand Up @@ -226,23 +252,6 @@ ClientRequest::process_pg_op(
get_foreign_connection().send_with_throttling(std::move(reply)));
}

ClientRequest::interruptible_future<>
ClientRequest::reply_op_error(const Ref<PG>& pg, int err)
{
LOG_PREFIX(ClientRequest::reply_op_error);
DEBUGDPP("{}: replying with error {}", *pg, *this, err);
auto reply = crimson::make_message<MOSDOpReply>(
m.get(), err, pg->get_osdmap_epoch(),
m->get_flags() & (CEPH_OSD_FLAG_ACK|CEPH_OSD_FLAG_ONDISK),
!m->has_flag(CEPH_OSD_FLAG_RETURNVEC));
reply->set_reply_versions(eversion_t(), 0);
reply->set_op_returns(std::vector<pg_log_op_return_item_t>{});
// TODO: gate the crosscore sending
return interruptor::make_interruptible(
get_foreign_connection().send_with_throttling(std::move(reply))
);
}

ClientRequest::interruptible_future<>
ClientRequest::process_op(
instance_handle_t &ihref, Ref<PG> pg, unsigned this_instance_id)
Expand Down
1 change: 1 addition & 0 deletions src/test/librados/misc_cxx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ TEST_F(LibRadosMiscPP, LongNamePP) {
}

TEST_F(LibRadosMiscPP, LongLocatorPP) {
SKIP_IF_CRIMSON();
bufferlist bl;
bl.append("content");
int maxlen = g_conf()->osd_max_object_name_len;
Expand Down
1 change: 1 addition & 0 deletions src/test/neorados/misc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ CORO_TEST_F(NeoRadosMisc, LongName, NeoRadosTest) {
}

CORO_TEST_F(NeoRadosMisc, LongLocator, NeoRadosTest) {
SKIP_IF_CRIMSON();
const auto maxlen = rados().cct()->_conf->osd_max_object_name_len;
const auto bl = to_buffer_list("content"sv);
{
Expand Down
2 changes: 2 additions & 0 deletions src/test/pybind/test_rados.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,8 @@ def test_xattrs_op(self):
self.ioctx.operate_write_op(write_op, 'abc')

def test_locator(self):
if os.getenv("CRIMSON_COMPAT") != None:
return
self.ioctx.set_locator_key("bar")
self.ioctx.write('foo', b'contents1')
objects = [i for i in self.ioctx.list_objects()]
Expand Down

0 comments on commit 226cba1

Please sign in to comment.