crimson ProtocolV2 class is following a state-machine design style:
* states are defined in ProtocolV2::state_t;
* call `execute_<state_name>()` methods to trigger different states;
* V2 logics are implemented in each execute_<state_name>() methods, and
with explicit transitions to other states at the end of the execute_*;
* each state is associated with a write state defined in Protocol.h:
- none: not allowed to send;
- delay: messages can be queued, but will be delayed to send;
- open: dispatch queued message/keepalive/ack;
- drop: not send any messages, drop them all.
crimson ProtocolV2 is alike async ProtocolV2, with some considerations:
* explicit and encapsulated client/server handshake workflow.
* futurized-exception-based fault handling, which can interrupt protocol
workflow at any time in each state.
* introduced SERVER_WAIT state, meaning to wait for peer-client's socket
to reset or be replaced, and expect no further reads.
* introduced an explicit REPLACING state, async-msgr would be at the
NONE state during replacing.
Signed-off-by: Yingxin Cheng <yingxincheng@gmail.com>
The simplest async-msgr server which will have the same behavior with
crimson-msgr server for apple-to-apple performance test.
Signed-off-by: Yingxin Cheng <yingxincheng@gmail.com>
New features:
* --jobs: start multiple client messengers from core #1 ~ #jobs;
* --core: can assign server core to get away from busy client cores;
* --rounds: a client will send <rounds>/<jobs> messages;
Improved:
* Better configuration report;
* Report individual client results plus a summary;
* Validate if CPU number is sufficient before running;
* Sleep 1 second while connecting, so it won't hurt performance;
* Simplify client logic and bug fixes;
Removed unecessary features:
* finish_decode() for MOSDOp;
* keepalive ratio;
Signed-off-by: Yingxin Cheng <yingxincheng@gmail.com>
sharded data structures should only be allocated in core#0, or the
program will hang during exit.
Signed-off-by: Yingxin Cheng <yingxincheng@gmail.com>
Instead of chaining writes with send_ready, connection will batch
messages in out_q, and will reap them by write_events() in the open
state.
The performance of pingpong is 3.7 times better from observation.
Signed-off-by: Yingxin Cheng <yingxincheng@gmail.com>
* introduce write_state_t to decouple write behaviors from states.
* replace `h.promise` with `state_changed`, with a more general way to
change write behaviors according to state switches.
* centralize write_event() to dispatch writes in the open state.
* friendly interface for v1/v2 protocol abstraction.
Signed-off-by: Yingxin Cheng <yingxincheng@gmail.com>
mgr/orchestrator: Add error handling to interface
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
Reviewed-by: Tim Serong <tserong@suse.com>
when building seastar with a recent fmt, fmt complains:
src/fmt/include/fmt/time.h:13:2: error: #warning fmt/time.h is
deprecated, use fmt/chrono.h instead [-Werror=cpp]
#warning fmt/time.h is deprecated, use fmt/chrono.h instead
^~~~~~~
Signed-off-by: Kefu Chai <kchai@redhat.com>