Repository navigation
crimson/net: change ConnectionRef to be a local_shared_foreign_ptr - #50835
Conversation
7e31cba to
5d0908f
Compare
|
Crimson test suite detects that |
Make ptr nullable and add necessary operators. Signed-off-by: Yingxin Cheng <[email protected]>
Signed-off-by: Yingxin Cheng <[email protected]>
Signed-off-by: Yingxin Cheng <[email protected]>
Make it possible for connections and messages to be dispatched in arbitrary core without asynchronous foreign copy. The local_shared_foreign_ptr conn cannot be moved to another core implicitly, maintain it outside Message independently. Do asynchronous foreign copy to the new ConnectionRef only in with_remote_shard_state_and_op(). Signed-off-by: Yingxin Cheng <[email protected]>
Signed-off-by: Yingxin Cheng <[email protected]>
00bb462 to
ebda490
Compare
|
changeset:
|
| get_local_state().registry.remove_from_registry(*op); | ||
| return with_remote_shard_state( | ||
| core, | ||
| [op=std::move(op)]( |
There was a problem hiding this comment.
Although T::IRef is a boost::intrusive_ptr, looks it works like unique-ptr with ceph_assert(op->use_count() == 1) above.
However, this still looks tricky to move the op to another core directly, it seems to result in allocating the op in one core and deallocate it in a different core, which should be wrong but I don't know why there is no visible failure.
Same applies to other unique-ptrs that may be owned by a different core, for example MessageURef should be a foreign-ptr.
There was a problem hiding this comment.
yes, that make me confused also.
There was a problem hiding this comment.
Ah, I see that seastar allocator can recognize and handle foreign free internally. So it is fine.
| conn.shared_from_this()); | ||
| Message *message = decode_message(nullptr, 0, header, footer, | ||
| msg_frame.front(), msg_frame.middle(), msg_frame.data(), conn_ref); | ||
| msg_frame.front(), msg_frame.middle(), msg_frame.data(), nullptr); |
There was a problem hiding this comment.
message and the new connection-ref have different core ownership, so decouple them and maintain them in crimson OSD independently.
crimson/net: change ConnectionRef to be a local_shared_foreign_ptr Reviewed-by: Samuel Just <[email protected]>
See ceph#50835. In crimson, conn is independently maintained outside Message. Therefore, when trying to use the message's connection for `get_orig_source_inst()` we won't be able to get the peer address. Fixes: https://tracker.ceph.com/issues/59589 Signed-off-by: Matan Breizman <[email protected]>
See ceph#50835. In crimson, conn is independently maintained outside Message. Therefore, when trying to use the message's connection for `get_peer_addr()` we won't be able to get the peer address. Signed-off-by: Matan Breizman <[email protected]>
In continuation to: ceph#50835 Do not include Crimson's SocketConnection in Message header. Signed-off-by: Matan Breizman <[email protected]>
See ceph#50835. In crimson, conn is independently maintained outside Message. Therefore, when trying to use the message's connection for `get_peer_addr()` we won't be able to get the peer address. Signed-off-by: Matan Breizman <[email protected]> (cherry picked from commit 9c1531c)
See ceph#50835. In crimson, conn is independently maintained outside Message. Therefore, when trying to use the message's connection for `get_orig_source_inst()` we won't be able to get the peer address. Fixes: https://tracker.ceph.com/issues/59589 Signed-off-by: Matan Breizman <[email protected]> (cherry picked from commit d569703)
In continuation to: ceph#50835 Do not include Crimson's SocketConnection in Message header. Signed-off-by: Matan Breizman <[email protected]>
In continuation to: ceph#50835 Do not include Crimson's SocketConnection in Message header. Signed-off-by: Matan Breizman <[email protected]>
Make it possible for connections and messages to be dispatched in
arbitrary core without asynchronous foreign copy.
The local_shared_foreign_ptr conn cannot be moved (with Message) to another core
implicitly, maintain it outside Message independently.
Do asynchronous foreign copy to the new ConnectionRef only in
with_remote_shard_state_and_op().
TODO: validate in CI.Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows