]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osdmap_gate: sort the blockers in ascending order of map epoch
authorXuehan Xu <xxhdx1985126@163.com>
Wed, 1 Apr 2020 11:52:25 +0000 (19:52 +0800)
committerXuehan Xu <xxhdx1985126@163.com>
Sun, 26 Apr 2020 07:46:35 +0000 (15:46 +0800)
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 <xxhdx1985126@163.com>
src/crimson/osd/osdmap_gate.h

index 0d7fa2ad4109b2e84980fc01773afbfb7de276a6..6a891cc152ace6afe0608474aa0010faaab06e43 100644 (file)
@@ -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<epoch_t,
-                                    OSDMapBlocker,
-                                    std::greater<epoch_t>>;
+                                    OSDMapBlocker>;
   const char *blocker_type;
   waiting_peering_t waiting_peering;
   epoch_t current = 0;