]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: pg_interval_t: a change in sort order triggers a new interval
authorSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 20:03:18 +0000 (16:03 -0400)
committerSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 20:23:46 +0000 (16:23 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/osd_types.cc
src/osd/osd_types.h
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 3ed3fe60f08b8bc761876739bcf1676bf52b856c..b256001b345ef8d154e724b4ee3d1f153a9f8664 100644 (file)
@@ -2646,6 +2646,8 @@ bool pg_interval_t::is_new_interval(
   int new_min_size,
   unsigned old_pg_num,
   unsigned new_pg_num,
+  bool old_sort_bitwise,
+  bool new_sort_bitwise,
   pg_t pgid) {
   return old_acting_primary != new_acting_primary ||
     new_acting != old_acting ||
@@ -2653,7 +2655,8 @@ bool pg_interval_t::is_new_interval(
     new_up != old_up ||
     old_min_size != new_min_size ||
     old_size != new_size ||
-    pgid.is_split(old_pg_num, new_pg_num, 0);
+    pgid.is_split(old_pg_num, new_pg_num, 0) ||
+    old_sort_bitwise != new_sort_bitwise;
 }
 
 bool pg_interval_t::is_new_interval(
@@ -2683,6 +2686,8 @@ bool pg_interval_t::is_new_interval(
                    osdmap->get_pools().find(pgid.pool())->second.min_size,
                    lastmap->get_pg_num(pgid.pool()),
                    osdmap->get_pg_num(pgid.pool()),
+                   lastmap->test_flag(CEPH_OSDMAP_SORTBITWISE),
+                   osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE),
                    pgid);
 }
 
index bfe24ca2fbcc3c8aab2b0ce7b0f2e12b498dc0cf..0c3848bec2386bd7748db8abf92b27daf00d7f1d 100644 (file)
@@ -1972,6 +1972,8 @@ struct pg_interval_t {
     int new_min_size,
     unsigned old_pg_num,
     unsigned new_pg_num,
+    bool old_sort_bitwise,
+    bool new_sort_bitwise,
     pg_t pgid
     );
 
index f82f6c7d064ae2da60e95b3e5b1f9902d4b3b11c..bc509cc7ab299778d83cb05bf2accefc5b595272 100644 (file)
@@ -2481,6 +2481,7 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend,  bool any
   vector<int> up, acting;
   osdmap->pg_to_up_acting_osds(pgid, &up, &up_primary,
                               &acting, &acting_primary);
+  bool sort_bitwise = osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE);
   if (any_change && pg_interval_t::is_new_interval(
           t->acting_primary,
          acting_primary,
@@ -2496,6 +2497,8 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend,  bool any
          min_size,
          t->pg_num,
          pg_num,
+         t->sort_bitwise,
+         sort_bitwise,
          pi->raw_pg_to_pg(pgid))) {
     force_resend = true;
   }
@@ -2521,6 +2524,7 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend,  bool any
     t->size = size;
     t->min_size = min_size;
     t->pg_num = pg_num;
+    t->sort_bitwise = sort_bitwise;
     ldout(cct, 10) << __func__ << " "
                   << " pgid " << pgid << " acting " << acting << dendl;
     t->used_replica = false;
index 65a3569cc2940e8eefd582632f4ed95d716143f0..d3c0effe90a289abab073ba1dc65527b6e5549f4 100644 (file)
@@ -1128,6 +1128,7 @@ public:
     int acting_primary;  ///< primary for last pg we mapped to based on the acting set
     int size;        ///< the size of the pool when were were last mapped
     int min_size;        ///< the min size of the pool when were were last mapped
+    bool sort_bitwise;   ///< whether the hobject_t sort order is bitwise
 
     bool used_replica;
     bool paused;
@@ -1144,6 +1145,7 @@ public:
        acting_primary(-1),
        size(-1),
        min_size(-1),
+       sort_bitwise(false),
        used_replica(false),
        paused(false),
        osd(-1)