From 0fcdeae18b0a8ec4e4f6bd3b0029c650ee15fea1 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 1 Jun 2020 23:06:31 +0300 Subject: [PATCH] Do not die if a peer is already stopped on flush error --- osd_flush.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osd_flush.cpp b/osd_flush.cpp index 9294bbb9..0fe46a0a 100644 --- a/osd_flush.cpp +++ b/osd_flush.cpp @@ -78,9 +78,12 @@ void osd_t::handle_flush_op(bool rollback, pg_num_t pg_num, pg_flush_batch_t *fb } else { - printf("Error while doing flush on OSD %lu: %s\n", osd_num, strerror(-retval)); - assert(c_cli.osd_peer_fds.find(peer_osd) != c_cli.osd_peer_fds.end()); - c_cli.stop_client(c_cli.osd_peer_fds[peer_osd]); + printf("Error while doing flush on OSD %lu: %d (%s)\n", osd_num, retval, strerror(-retval)); + auto fd_it = c_cli.osd_peer_fds.find(peer_osd); + if (fd_it != c_cli.osd_peer_fds.end()) + { + c_cli.stop_client(fd_it->second); + } return; } }