Skip to content

Commit 226cba1

Browse files
authored
Merge pull request ceph#56025 from xxhdx1985126/wip-seastore-onode-loc-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]>
2 parents 5504baf + 776c2b3 commit 226cba1

File tree

4 files changed

+30
-17
lines changed

4 files changed

+30
-17
lines changed

src/crimson/osd/osd_operations/client_request.cc

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,23 @@ bool ClientRequest::is_pg_op() const
9999
[](auto& op) { return ceph_osd_op_type_pg(op.op.op); });
100100
}
101101

102+
ClientRequest::interruptible_future<>
103+
ClientRequest::reply_op_error(const Ref<PG>& pg, int err)
104+
{
105+
LOG_PREFIX(ClientRequest::reply_op_error);
106+
DEBUGDPP("{}: replying with error {}", *pg, *this, err);
107+
auto reply = crimson::make_message<MOSDOpReply>(
108+
m.get(), err, pg->get_osdmap_epoch(),
109+
m->get_flags() & (CEPH_OSD_FLAG_ACK|CEPH_OSD_FLAG_ONDISK),
110+
!m->has_flag(CEPH_OSD_FLAG_RETURNVEC));
111+
reply->set_reply_versions(eversion_t(), 0);
112+
reply->set_op_returns(std::vector<pg_log_op_return_item_t>{});
113+
// TODO: gate the crosscore sending
114+
return interruptor::make_interruptible(
115+
get_foreign_connection().send_with_throttling(std::move(reply))
116+
);
117+
}
118+
102119
ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptible(
103120
Ref<PG> pgref, const unsigned this_instance_id, instance_handle_t &ihref)
104121
{
@@ -109,6 +126,15 @@ ClientRequest::interruptible_future<> ClientRequest::with_pg_process_interruptib
109126

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

229-
ClientRequest::interruptible_future<>
230-
ClientRequest::reply_op_error(const Ref<PG>& pg, int err)
231-
{
232-
LOG_PREFIX(ClientRequest::reply_op_error);
233-
DEBUGDPP("{}: replying with error {}", *pg, *this, err);
234-
auto reply = crimson::make_message<MOSDOpReply>(
235-
m.get(), err, pg->get_osdmap_epoch(),
236-
m->get_flags() & (CEPH_OSD_FLAG_ACK|CEPH_OSD_FLAG_ONDISK),
237-
!m->has_flag(CEPH_OSD_FLAG_RETURNVEC));
238-
reply->set_reply_versions(eversion_t(), 0);
239-
reply->set_op_returns(std::vector<pg_log_op_return_item_t>{});
240-
// TODO: gate the crosscore sending
241-
return interruptor::make_interruptible(
242-
get_foreign_connection().send_with_throttling(std::move(reply))
243-
);
244-
}
245-
246255
ClientRequest::interruptible_future<>
247256
ClientRequest::process_op(
248257
instance_handle_t &ihref, Ref<PG> pg, unsigned this_instance_id)

src/test/librados/misc_cxx.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ TEST_F(LibRadosMiscPP, LongNamePP) {
5050
}
5151

5252
TEST_F(LibRadosMiscPP, LongLocatorPP) {
53+
SKIP_IF_CRIMSON();
5354
bufferlist bl;
5455
bl.append("content");
5556
int maxlen = g_conf()->osd_max_object_name_len;

src/test/neorados/misc.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ CORO_TEST_F(NeoRadosMisc, LongName, NeoRadosTest) {
6868
}
6969

7070
CORO_TEST_F(NeoRadosMisc, LongLocator, NeoRadosTest) {
71+
SKIP_IF_CRIMSON();
7172
const auto maxlen = rados().cct()->_conf->osd_max_object_name_len;
7273
const auto bl = to_buffer_list("content"sv);
7374
{

src/test/pybind/test_rados.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,8 @@ def test_xattrs_op(self):
715715
self.ioctx.operate_write_op(write_op, 'abc')
716716

717717
def test_locator(self):
718+
if os.getenv("CRIMSON_COMPAT") != None:
719+
return
718720
self.ioctx.set_locator_key("bar")
719721
self.ioctx.write('foo', b'contents1')
720722
objects = [i for i in self.ioctx.list_objects()]

0 commit comments

Comments
 (0)