crimson/net: STANDBY state for lossless server or peer

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
This commit is contained in:
Yingxin Cheng 2019-08-08 16:25:43 +08:00
parent dd59586ef0
commit f8053d08ee
4 changed files with 16 additions and 3 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;