mirror of
https://github.com/ceph/ceph
synced 2025-02-24 11:37:37 +00:00
crimson/net: STANDBY state for lossless server or peer
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
This commit is contained in:
parent
dd59586ef0
commit
f8053d08ee
@ -265,6 +265,7 @@ seastar::future<stop_t> Protocol::do_write_dispatch_sweep()
|
||||
|
||||
void Protocol::write_event()
|
||||
{
|
||||
notify_write();
|
||||
if (write_dispatching) {
|
||||
// already dispatching
|
||||
return;
|
||||
|
@ -47,6 +47,8 @@ class Protocol {
|
||||
std::optional<utime_t> keepalive_ack,
|
||||
bool require_ack) = 0;
|
||||
|
||||
virtual void notify_write() {};
|
||||
|
||||
public:
|
||||
const proto_t proto_type;
|
||||
|
||||
|
@ -1759,9 +1759,17 @@ void ProtocolV2::execute_ready()
|
||||
|
||||
void ProtocolV2::execute_standby()
|
||||
{
|
||||
// TODO not implemented
|
||||
// trigger_state(state_t::STANDBY, write_state_t::delay, false);
|
||||
ceph_assert(false);
|
||||
trigger_state(state_t::STANDBY, write_state_t::delay, true);
|
||||
if (socket) {
|
||||
socket->shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
void ProtocolV2::notify_write()
|
||||
{
|
||||
if (unlikely(state == state_t::STANDBY && !conn.policy.server)) {
|
||||
execute_connecting();
|
||||
}
|
||||
}
|
||||
|
||||
// WAIT state
|
||||
|
@ -32,6 +32,8 @@ class ProtocolV2 final : public Protocol {
|
||||
std::optional<utime_t> keepalive_ack,
|
||||
bool require_ack) override;
|
||||
|
||||
void notify_write() override;
|
||||
|
||||
private:
|
||||
SocketMessenger &messenger;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user