]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/osd/PGBackend.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / osd / PGBackend.h
index b9641a5305c7b9b3caeece706b47188686f454e2..4a952c4ed8bd9ca4173a6a95623f070eacc5ad94 100644 (file)
@@ -25,6 +25,7 @@
 #include "common/LogClient.h"
 #include <string>
 #include "PGTransaction.h"
+#include "common/ostream_temp.h"
 
 namespace Scrub {
   class Store;
@@ -105,35 +106,33 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
        pg_shard_t peer,
        const hobject_t oid) = 0;
 
-     virtual void failed_push(const list<pg_shard_t> &from,
-                              const hobject_t &soid,
-                              const eversion_t &need = eversion_t()) = 0;
-     virtual void finish_degraded_object(const hobject_t oid) = 0;
-     virtual void primary_failed(const hobject_t &soid) = 0;
-     virtual bool primary_error(const hobject_t& soid, eversion_t v) = 0;
-     virtual void cancel_pull(const hobject_t &soid) = 0;
-
      virtual void apply_stats(
        const hobject_t &soid,
        const object_stat_sum_t &delta_stats) = 0;
 
      /**
-      * Called when a read on the primary fails when pushing
+      * Called when a read from a set of replicas/primary fails
       */
-     virtual void on_primary_error(
-       const hobject_t &oid,
-       eversion_t v
-       ) = 0;
-
-     virtual void backfill_add_missing(
-       const hobject_t &oid,
-       eversion_t v
+     virtual void on_failed_pull(
+       const set<pg_shard_t> &from,
+       const hobject_t &soid,
+       const eversion_t &v
        ) = 0;
 
-     virtual void remove_missing_object(const hobject_t &oid,
-                                       eversion_t v,
-                                       Context *on_complete) = 0;
+     /**
+      * Called when a pull on soid cannot be completed due to
+      * down peers
+      */
+     virtual void cancel_pull(
+       const hobject_t &soid) = 0;
 
+     /**
+      * Called to remove an object.
+      */
+     virtual void remove_missing_object(
+       const hobject_t &oid,
+       eversion_t v,
+       Context *on_complete) = 0;
 
      /**
       * Bless a context
@@ -172,17 +171,17 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
      virtual void add_local_next_event(const pg_log_entry_t& e) = 0;
      virtual const map<pg_shard_t, pg_missing_t> &get_shard_missing()
        const = 0;
-     virtual boost::optional<const pg_missing_const_i &> maybe_get_shard_missing(
+     virtual const pg_missing_const_i * maybe_get_shard_missing(
        pg_shard_t peer) const {
        if (peer == primary_shard()) {
-        return get_local_missing();
+        return &get_local_missing();
        } else {
         map<pg_shard_t, pg_missing_t>::const_iterator i =
           get_shard_missing().find(peer);
         if (i == get_shard_missing().end()) {
-          return boost::optional<const pg_missing_const_i &>();
+          return nullptr;
         } else {
-          return i->second;
+          return &(i->second);
         }
        }
      }
@@ -233,9 +232,10 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
 
      virtual void log_operation(
        const vector<pg_log_entry_t> &logv,
-       const boost::optional<pg_hit_set_history_t> &hset_history,
+       const std::optional<pg_hit_set_history_t> &hset_history,
        const eversion_t &trim_to,
        const eversion_t &roll_forward_to,
+       const eversion_t &min_last_complete_ondisk,
        bool transaction_applied,
        ObjectStore::Transaction &t,
        bool async = false) = 0;
@@ -272,12 +272,14 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
 
      virtual spg_t primary_spg_t() const = 0;
      virtual pg_shard_t primary_shard() const = 0;
-
+     virtual uint64_t min_peer_features() const = 0;
      virtual hobject_t get_temp_recovery_object(const hobject_t& target,
                                                eversion_t version) = 0;
 
-     virtual void send_message_osd_cluster(
+      virtual void send_message_osd_cluster(
        int peer, Message *m, epoch_t from_epoch) = 0;
+      virtual void send_message_osd_cluster(
+       std::vector<std::pair<int, Message*>>& messages, epoch_t from_epoch) = 0;
      virtual void send_message_osd_cluster(
        Message *m, Connection *con) = 0;
      virtual void send_message_osd_cluster(
@@ -289,13 +291,11 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
 
      virtual ceph_tid_t get_tid() = 0;
 
-     virtual LogClientTemp clog_error() = 0;
-     virtual LogClientTemp clog_warn() = 0;
+     virtual OstreamTemp clog_error() = 0;
+     virtual OstreamTemp clog_warn() = 0;
 
      virtual bool check_failsafe_full() = 0;
 
-     virtual bool check_osdmap_full(const set<pg_shard_t> &missing_on) = 0;
-
      virtual bool pg_is_repair() = 0;
      virtual void inc_osd_stat_repaired() = 0;
      virtual bool pg_is_remote_backfilling() = 0;
@@ -449,10 +449,11 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
      const eversion_t &at_version,        ///< [in] version
      PGTransactionUPtr &&t,               ///< [in] trans to execute (move)
      const eversion_t &trim_to,           ///< [in] trim log to here
-     const eversion_t &roll_forward_to,  ///< [in] trim rollback info to here
+     const eversion_t &min_last_complete_ondisk, ///< [in] lower bound on
+                                                 ///  committed version
      const vector<pg_log_entry_t> &log_entries, ///< [in] log entries for t
      /// [in] hitset history (if updated with this transaction)
-     boost::optional<pg_hit_set_history_t> &hset_history,
+     std::optional<pg_hit_set_history_t> &hset_history,
      Context *on_all_commit,              ///< [in] called when all commit
      ceph_tid_t tid,                      ///< [in] tid
      osd_reqid_t reqid,                   ///< [in] reqid
@@ -492,7 +493,7 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
    /// Reapply old attributes
    void rollback_setattrs(
      const hobject_t &hoid,
-     map<string, boost::optional<bufferlist> > &old_attrs,
+     map<string, std::optional<bufferlist> > &old_attrs,
      ObjectStore::Transaction *t);
 
    /// Truncate object to rollback append
@@ -564,6 +565,14 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
      uint32_t op_flags,
      bufferlist *bl) = 0;
 
+   virtual int objects_readv_sync(
+     const hobject_t &hoid,
+     map<uint64_t, uint64_t>&& m,
+     uint32_t op_flags,
+     bufferlist *bl) {
+     return -EOPNOTSUPP;
+   }
+
    virtual void objects_read_async(
      const hobject_t &hoid,
      const list<pair<boost::tuple<uint64_t, uint64_t, uint32_t>,
@@ -598,8 +607,8 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
      map<hobject_t, set<pg_shard_t>> &missing,
      map<hobject_t, set<pg_shard_t>> &inconsistent,
      map<hobject_t, list<pg_shard_t>> &authoritative,
-     map<hobject_t, pair<boost::optional<uint32_t>,
-                         boost::optional<uint32_t>>> &missing_digest,
+     map<hobject_t, pair<std::optional<uint32_t>,
+                         std::optional<uint32_t>>> &missing_digest,
      int &shallow_errors, int &deep_errors,
      Scrub::Store *store,
      const spg_t& pgid,