From ff08cb6b3671f5ae7381da77919b22ecf2926103 Mon Sep 17 00:00:00 2001 From: Xuehan Xu Date: Wed, 1 Apr 2020 19:52:25 +0800 Subject: [PATCH] crimson/osdmap_gate: sort the blockers in ascending order of map epoch When the osdmap_gate got a new map, it's supposed to release blocked ops on all previous maps section of which is represented by [waiting_peering.begin(), waiting_peering.upper_bound(epoch)]. So it's essentail that waiting_peering is ordered in ascending order of the map epoch Signed-off-by: Xuehan Xu --- src/crimson/osd/osdmap_gate.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/crimson/osd/osdmap_gate.h b/src/crimson/osd/osdmap_gate.h index 0d7fa2ad410..6a891cc152a 100644 --- a/src/crimson/osd/osdmap_gate.h +++ b/src/crimson/osd/osdmap_gate.h @@ -42,12 +42,11 @@ class OSDMapGate { } }; - // order the promises in descending order of the waited osdmap epoch, + // order the promises in ascending order of the waited osdmap epoch, // so we can access all the waiters expecting a map whose epoch is less - // than a given epoch + // than or equal to a given epoch using waiting_peering_t = std::map>; + OSDMapBlocker>; const char *blocker_type; waiting_peering_t waiting_peering; epoch_t current = 0; -- 2.39.5