]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd_types, Objecter: make recovery_deletes feature create a new interval
authorJosh Durgin <jdurgin@redhat.com>
Tue, 4 Jul 2017 02:05:03 +0000 (22:05 -0400)
committerJosh Durgin <jdurgin@redhat.com>
Wed, 19 Jul 2017 06:47:45 +0000 (02:47 -0400)
This is needed to create a single place to regenerate the missing set
- at the start of a new interval where support for recovery deletes
changed.

The missing set is otherwise not cleared, so it would need to be
rebuilt in arbitrary places if e.g. an osd not supporting it went down
and restarted with support, or if we used a feature flag command to
trigger rebuilding the missing set.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/osd/osd_types.cc
src/osd/osd_types.h
src/osdc/Objecter.cc
src/osdc/Objecter.h

index bbacdb38aa20ac7e0ca06dc1866114e25efb9463..8913f12b9cd92cbec4ca533eb810d34ad387c20b 100644 (file)
@@ -3396,6 +3396,8 @@ bool PastIntervals::is_new_interval(
   unsigned new_pg_num,
   bool old_sort_bitwise,
   bool new_sort_bitwise,
+  bool old_recovery_deletes,
+  bool new_recovery_deletes,
   pg_t pgid) {
   return old_acting_primary != new_acting_primary ||
     new_acting != old_acting ||
@@ -3404,7 +3406,8 @@ bool PastIntervals::is_new_interval(
     old_min_size != new_min_size ||
     old_size != new_size ||
     pgid.is_split(old_pg_num, new_pg_num, 0) ||
-    old_sort_bitwise != new_sort_bitwise;
+    old_sort_bitwise != new_sort_bitwise ||
+    old_recovery_deletes != new_recovery_deletes;
 }
 
 bool PastIntervals::is_new_interval(
@@ -3436,6 +3439,8 @@ bool PastIntervals::is_new_interval(
                    osdmap->get_pg_num(pgid.pool()),
                    lastmap->test_flag(CEPH_OSDMAP_SORTBITWISE),
                    osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE),
+                   lastmap->test_flag(CEPH_OSDMAP_RECOVERY_DELETES),
+                   osdmap->test_flag(CEPH_OSDMAP_RECOVERY_DELETES),
                    pgid);
 }
 
index 87166584f2480ccddafb18e2fb7ecccb71121427..6bc75e3dbdeda5e456928bfcb541d56df43ea9ef 100644 (file)
@@ -2680,6 +2680,8 @@ public:
     unsigned new_pg_num,
     bool old_sort_bitwise,
     bool new_sort_bitwise,
+    bool old_recovery_deletes,
+    bool new_recovery_deletes,
     pg_t pgid
     );
 
@@ -2722,6 +2724,7 @@ public:
     PastIntervals *past_intervals,              ///< [out] intervals
     ostream *out = 0                            ///< [out] debug ostream
     );
+
   friend ostream& operator<<(ostream& out, const PastIntervals &i);
 
   template <typename F>
index fde68cd1ba600b4fce5af2dc663525883cbc6f27..fc870badd603e793eb0ac06cd18115b472500e9d 100644 (file)
@@ -2821,6 +2821,7 @@ int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change)
   osdmap->pg_to_up_acting_osds(pgid, &up, &up_primary,
                               &acting, &acting_primary);
   bool sort_bitwise = osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE);
+  bool recovery_deletes = osdmap->test_flag(CEPH_OSDMAP_RECOVERY_DELETES);
   unsigned prev_seed = ceph_stable_mod(pgid.ps(), t->pg_num, t->pg_num_mask);
   pg_t prev_pgid(prev_seed, pgid.pool());
   if (any_change && PastIntervals::is_new_interval(
@@ -2840,6 +2841,8 @@ int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change)
        pg_num,
        t->sort_bitwise,
        sort_bitwise,
+       t->recovery_deletes,
+       recovery_deletes,
        prev_pgid)) {
     force_resend = true;
   }
@@ -2874,6 +2877,7 @@ int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change)
       pg_t(ceph_stable_mod(pgid.ps(), t->pg_num, t->pg_num_mask), pgid.pool()),
       &t->actual_pgid);
     t->sort_bitwise = sort_bitwise;
+    t->recovery_deletes = recovery_deletes;
     ldout(cct, 10) << __func__ << " "
                   << " raw pgid " << pgid << " -> actual " << t->actual_pgid
                   << " acting " << acting
index ee40e76a5307e8e8a2bd8479c5889fe36e92c518..edcee5b922d9f52eda5702d030a6326ac35cb80c 100644 (file)
@@ -1277,6 +1277,7 @@ public:
     int size = -1; ///< the size of the pool when were were last mapped
     int min_size = -1; ///< the min size of the pool when were were last mapped
     bool sort_bitwise = false; ///< whether the hobject_t sort order is bitwise
+    bool recovery_deletes = false; ///< whether the deletes are performed during recovery instead of peering
 
     bool used_replica = false;
     bool paused = false;