]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/osd/PG.h
update sources to v12.1.2
[ceph.git] / ceph / src / osd / PG.h
index a033763b4f9d1ed81cda841fbca24b23b4c2131d..5ce78db003ae19d4e28575fb4db1ca4069c8b0af 100644 (file)
@@ -403,8 +403,14 @@ public:
        *v = i->second.need;
       return true;
     }
+    bool is_deleted(const hobject_t &hoid) const {
+      auto i = needs_recovery_map.find(hoid);
+      if (i == needs_recovery_map.end())
+       return false;
+      return i->second.is_delete();
+    }
     bool is_unfound(const hobject_t &hoid) const {
-      return needs_recovery(hoid) && (
+      return needs_recovery(hoid) && !is_deleted(hoid) && (
        !missing_loc.count(hoid) ||
        !(*is_recoverable)(missing_loc.find(hoid)->second));
     }
@@ -455,6 +461,9 @@ public:
        if (j == needs_recovery_map.end()) {
          needs_recovery_map.insert(*i);
        } else {
+         lgeneric_dout(pg->cct, 0) << this << " " << pg->info.pgid << " unexpected need for "
+                                   << i->first << " have " << j->second
+                                   << " tried to add " << i->second << dendl;
          assert(i->second.need == j->second.need);
        }
       }
@@ -522,6 +531,8 @@ public:
        return; // recovered!
 
       needs_recovery_map[hoid] = *item;
+      if (item->is_delete())
+       return;
       auto mliter =
        missing_loc.insert(make_pair(hoid, set<pg_shard_t>())).first;
       assert(info.last_backfill.is_max());
@@ -963,12 +974,15 @@ public:
   bool needs_recovery() const;
   bool needs_backfill() const;
 
+  /// clip calculated priority to reasonable range
+  inline int clamp_recovery_priority(int priority);
   /// get log recovery reservation priority
   unsigned get_recovery_priority();
   /// get backfill reservation priority
   unsigned get_backfill_priority();
 
   void mark_clean();  ///< mark an active pg clean
+  void change_recovery_force_mode(int new_mode, bool clear);
 
   /// return [start,end) bounds for required past_intervals
   static pair<epoch_t, epoch_t> get_required_past_interval_bounds(
@@ -1916,9 +1930,14 @@ public:
 
     struct NotRecovering : boost::statechart::state< NotRecovering, Active>, NamedState {
       typedef boost::mpl::list<
-       boost::statechart::transition< DoRecovery, WaitLocalRecoveryReserved >
+       boost::statechart::transition< DoRecovery, WaitLocalRecoveryReserved >,
+       boost::statechart::custom_reaction< CancelRecovery >
        > reactions;
       explicit NotRecovering(my_context ctx);
+      boost::statechart::result react(const CancelRecovery& evt) {
+       /* no-op */
+       return discard_event();
+      }
       void exit();
     };
 
@@ -2215,6 +2234,9 @@ public:
 
   uint64_t get_min_acting_features() const { return acting_features; }
   uint64_t get_min_upacting_features() const { return upacting_features; }
+  bool perform_deletes_during_peering() const {
+    return !(get_osdmap()->test_flag(CEPH_OSDMAP_RECOVERY_DELETES));
+  }
 
   void init_primary_up_acting(
     const vector<int> &newup,
@@ -2381,7 +2403,7 @@ public:
   virtual void kick_snap_trim() = 0;
   virtual void snap_trimmer_scrub_complete() = 0;
   bool requeue_scrub(bool high_priority = false);
-  void queue_recovery(bool front = false);
+  void queue_recovery();
   bool queue_scrub();
   unsigned get_scrub_priority();