]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Objecter: pg_interval_t::is_new_interval needs pgid from previous pool 5648/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 21 Aug 2015 15:32:39 +0000 (11:32 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 24 Aug 2015 15:12:13 +0000 (11:12 -0400)
When increasing the pg_num of a pool, an assert would fail since the
calculated pgid seed would be for the pool's new pg_num value instead
of the previous pg_num value.

Fixes: #10399
Backport: infernalis, hammer, firefly
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 16c75fa77ee7a176539cb2d8d4390ec949373fbc..709ddc0f22d230c49127af47c3f0dba4f2c1d38a 100644 (file)
@@ -2482,6 +2482,7 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend,  bool any
   osdmap->pg_to_up_acting_osds(pgid, &up, &up_primary,
                               &acting, &acting_primary);
   bool sort_bitwise = osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE);
+  unsigned prev_seed = ceph_stable_mod(pgid.ps(), t->pg_num, t->pg_num_mask);
   if (any_change && pg_interval_t::is_new_interval(
           t->acting_primary,
          acting_primary,
@@ -2499,7 +2500,7 @@ int Objecter::_calc_target(op_target_t *t, epoch_t *last_force_resend,  bool any
          pg_num,
          t->sort_bitwise,
          sort_bitwise,
-         pi->raw_pg_to_pg(pgid))) {
+         pg_t(prev_seed, pgid.pool(), pgid.preferred()))) {
     force_resend = true;
   }
 
@@ -2524,6 +2525,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->pg_num_mask = pi->get_pg_num_mask();
     t->sort_bitwise = sort_bitwise;
     ldout(cct, 10) << __func__ << " "
                   << " pgid " << pgid << " acting " << acting << dendl;
index 9e1da17b4844b1d957610261aae7dd1da18e61fe..232643a37687948fe0cc9982a071945f068615f6 100644 (file)
@@ -1123,18 +1123,19 @@ public:
     object_t target_oid;
     object_locator_t target_oloc;
 
-    bool precalc_pgid;   ///< true if we are directed at base_pgid, not base_oid
-    pg_t base_pgid;      ///< explciti pg target, if any
-
-    pg_t pgid;           ///< last pg we mapped to
-    unsigned pg_num;     ///< last pg_num we mapped to
-    vector<int> up;      ///< set of up osds for last pg we mapped to
-    vector<int> acting;  ///< set of acting osds for last pg we mapped to
-    int up_primary;      ///< primary for last pg we mapped to based on the up set
-    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 precalc_pgid;    ///< true if we are directed at base_pgid, not base_oid
+    pg_t base_pgid;       ///< explciti pg target, if any
+
+    pg_t pgid;            ///< last pg we mapped to
+    unsigned pg_num;      ///< last pg_num we mapped to
+    unsigned pg_num_mask; ///< last pg_num_mask we mapped to
+    vector<int> up;       ///< set of up osds for last pg we mapped to
+    vector<int> acting;   ///< set of acting osds for last pg we mapped to
+    int up_primary;       ///< primary for last pg we mapped to based on the up set
+    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;
@@ -1147,6 +1148,7 @@ public:
        base_oloc(oloc),
        precalc_pgid(false),
        pg_num(0),
+        pg_num_mask(0),
        up_primary(-1),
        acting_primary(-1),
        size(-1),