IOHandler::to_new_sid provides a mechanism to switch to a new core from the current one used.
This behavior is tricky for making sure that we keep the IOHandler::shard_states_t::gate instance to be used on the same core that it was created.
In order to resolve this, we should be able to construct Gated out of specified core_id (and not from this_shard_id).
See: https://github.com/ceph/ceph/pull/58986#discussion_r1733782952
Signed-off-by: NitzanMordhai <nmordech@redhat.com>
class Gated {
public:
Gated() : sid(seastar::this_shard_id()) {}
+ Gated(const seastar::shard_id sid) : sid(sid) {}
Gated(const Gated&) = delete;
Gated& operator=(const Gated&) = delete;
Gated(Gated&&) = default;
class shard_states_t {
public:
shard_states_t(seastar::shard_id _sid, io_state_t state)
- : sid{_sid}, io_state{state} {}
+ : sid{_sid}, io_state{state}, gate{_sid} {}
seastar::shard_id get_shard_id() const {
return sid;