From 699fc054a8604caae637b4de8c0e7c204ddcc25e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 10 Nov 2014 16:04:38 -0800 Subject: [PATCH] msg/simple: ms_die_on_skipped_message Assert if we skip an incoming seq. The SimpleMessenger never does this, but the kernel messenger does. Hopefully useful for tracking down bugs like #10057. Signed-off-by: Sage Weil --- src/common/config_opts.h | 1 + src/msg/simple/Pipe.cc | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index be9cb1311a8..10c7ad1c666 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -123,6 +123,7 @@ OPTION(ms_nocrc, OPT_BOOL, false) OPTION(ms_die_on_bad_msg, OPT_BOOL, false) OPTION(ms_die_on_unhandled_msg, OPT_BOOL, false) OPTION(ms_die_on_old_message, OPT_BOOL, false) // assert if we get a dup incoming message and shouldn't have (may be triggered by pre-541cd3c64be0dfa04e8a2df39422e0eb9541a428 code) +OPTION(ms_die_on_skipped_message, OPT_BOOL, false) // assert if we skip a seq (kernel client does this intentionally) OPTION(ms_dispatch_throttle_bytes, OPT_U64, 100 << 20) OPTION(ms_bind_ipv6, OPT_BOOL, false) OPTION(ms_bind_port_min, OPT_INT, 6800) diff --git a/src/msg/simple/Pipe.cc b/src/msg/simple/Pipe.cc index efd5e4d1ed2..3ff1fb1937b 100644 --- a/src/msg/simple/Pipe.cc +++ b/src/msg/simple/Pipe.cc @@ -1572,6 +1572,12 @@ void Pipe::reader() assert(0 == "old msgs despite reconnect_seq feature"); continue; } + if (m->get_seq() > in_seq + 1) { + ldout(msgr->cct,0) << "reader missed message? skipped from seq " + << in_seq << " to " << m->get_seq() << dendl; + if (msgr->cct->_conf->ms_die_on_skipped_message) + assert(0 == "skipped incoming seq"); + } m->set_connection(connection_state.get()); -- 2.47.3