From 46e111272fc550a4fadba27f5c782acf1912fde8 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 2 Jun 2020 14:30:57 +0300 Subject: [PATCH] Replace assert(this_it == cur_op) with if() for the case of PG repeering --- osd_primary.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/osd_primary.cpp b/osd_primary.cpp index f96253bb..a1663f4b 100644 --- a/osd_primary.cpp +++ b/osd_primary.cpp @@ -293,14 +293,15 @@ resume_7: // Continue other write operations to the same object auto next_it = pg.write_queue.find(oid); auto this_it = next_it; - assert(this_it->second == cur_op); - next_it++; - pg.write_queue.erase(this_it); - if (next_it != pg.write_queue.end() && - next_it->first == oid) + if (this_it != pg.write_queue.end() && this_it->second == cur_op) { - osd_op_t *next_op = next_it->second; - continue_primary_write(next_op); + next_it++; + pg.write_queue.erase(this_it); + if (next_it != pg.write_queue.end() && next_it->first == oid) + { + osd_op_t *next_op = next_it->second; + continue_primary_write(next_op); + } } } @@ -661,12 +662,15 @@ resume_7: // Continue other write operations to the same object auto next_it = pg.write_queue.find(oid); auto this_it = next_it; - next_it++; - pg.write_queue.erase(this_it); - if (next_it != pg.write_queue.end() && - next_it->first == oid) + if (this_it != pg.write_queue.end() && this_it->second == cur_op) { - osd_op_t *next_op = next_it->second; - continue_primary_write(next_op); + next_it++; + pg.write_queue.erase(this_it); + if (next_it != pg.write_queue.end() && + next_it->first == oid) + { + osd_op_t *next_op = next_it->second; + continue_primary_write(next_op); + } } }