]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: use global id instead of entity_inst_t as client identifier
authorSage Weil <sage@redhat.com>
Wed, 13 Sep 2017 20:28:10 +0000 (16:28 -0400)
committerSage Weil <sage@redhat.com>
Wed, 13 Sep 2017 20:28:10 +0000 (16:28 -0400)
entity_inst_t is huge; use uint64_t instead.

Note that this will currently confuse mds.0 vs osd.0, but we plan
to switch the mds to use mds.$gid soon anyway so that will go
away.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h
src/osd/PGQueueable.h
src/osd/mClockClientQueue.h
src/osd/mClockOpClassQueue.h

index 0dd6155274799147d7cf71475bac2a2c41efaaa8..d74000e70b96c0eef90065d441657a0b3dfb0558 100644 (file)
@@ -1697,7 +1697,7 @@ void OSDService::queue_for_snap_trim(PG *pg)
        cct->_conf->osd_snap_trim_cost,
        cct->_conf->osd_snap_trim_priority,
        ceph_clock_now(),
-       entity_inst_t(),
+       0,
        pg->get_osdmap()->get_epoch())));
 }
 
index 575d84c7e15721669d17751f02f7c1d6b15b6a74..b864dda040ce104bc084ed09c84e5a676420e39f 100644 (file)
@@ -871,7 +871,7 @@ public:
        cct->_conf->osd_scrub_cost,
        scrub_queue_priority,
        ceph_clock_now(),
-       entity_inst_t(),
+       0,
        pg->get_osdmap()->get_epoch()));
   }
 
@@ -899,7 +899,7 @@ private:
        cct->_conf->osd_recovery_cost,
        cct->_conf->osd_recovery_priority,
        ceph_clock_now(),
-       entity_inst_t(),
+       0,
        p.first));
   }
 public:
@@ -1650,7 +1650,7 @@ private:
       unordered_map<spg_t,pg_slot> pg_slots;
 
       /// priority queue
-      std::unique_ptr<OpQueue< pair<spg_t, PGQueueable>, entity_inst_t>> pqueue;
+      std::unique_ptr<OpQueue< pair<spg_t, PGQueueable>, uint64_t>> pqueue;
 
       void _enqueue_front(pair<spg_t, PGQueueable> item, unsigned cutoff) {
        unsigned priority = item.second.get_priority();
@@ -1674,13 +1674,13 @@ private:
                                 false, cct) {
        if (opqueue == io_queue::weightedpriority) {
          pqueue = std::unique_ptr
-           <WeightedPriorityQueue<pair<spg_t,PGQueueable>,entity_inst_t>>(
-             new WeightedPriorityQueue<pair<spg_t,PGQueueable>,entity_inst_t>(
+           <WeightedPriorityQueue<pair<spg_t,PGQueueable>,uint64_t>>(
+             new WeightedPriorityQueue<pair<spg_t,PGQueueable>,uint64_t>(
                max_tok_per_prio, min_cost));
        } else if (opqueue == io_queue::prioritized) {
          pqueue = std::unique_ptr
-           <PrioritizedQueue<pair<spg_t,PGQueueable>,entity_inst_t>>(
-             new PrioritizedQueue<pair<spg_t,PGQueueable>,entity_inst_t>(
+           <PrioritizedQueue<pair<spg_t,PGQueueable>,uint64_t>>(
+             new PrioritizedQueue<pair<spg_t,PGQueueable>,uint64_t>(
                max_tok_per_prio, min_cost));
        } else if (opqueue == io_queue::mclock_opclass) {
          pqueue = std::unique_ptr
index cb32e52b782ac817b4bf2f7c1c45747de4424963..9eeadc038e6ae0c549fbaecf73ac777b3edd64c1 100644 (file)
@@ -65,7 +65,7 @@ class PGQueueable {
   int cost;
   unsigned priority;
   utime_t start_time;
-  entity_inst_t owner;
+  uint64_t owner;  ///< global id (e.g., client.XXX)
   epoch_t map_epoch;    ///< an epoch we expect the PG to exist in
 
   struct RunVis : public boost::static_visitor<> {
@@ -108,22 +108,22 @@ public:
     : qvariant(op), cost(op->get_req()->get_cost()),
       priority(op->get_req()->get_priority()),
       start_time(op->get_req()->get_recv_stamp()),
-      owner(op->get_req()->get_source_inst()),
+      owner(op->get_req()->get_source().num()),
       map_epoch(e)
     {}
   PGQueueable(
     const PGSnapTrim &op, int cost, unsigned priority, utime_t start_time,
-    const entity_inst_t &owner, epoch_t e)
+    uint64_t owner, epoch_t e)
     : qvariant(op), cost(cost), priority(priority), start_time(start_time),
       owner(owner), map_epoch(e) {}
   PGQueueable(
     const PGScrub &op, int cost, unsigned priority, utime_t start_time,
-    const entity_inst_t &owner, epoch_t e)
+    uint64_t owner, epoch_t e)
     : qvariant(op), cost(cost), priority(priority), start_time(start_time),
       owner(owner), map_epoch(e) {}
   PGQueueable(
     const PGRecovery &op, int cost, unsigned priority, utime_t start_time,
-    const entity_inst_t &owner, epoch_t e)
+    uint64_t owner, epoch_t e)
     : qvariant(op), cost(cost), priority(priority), start_time(start_time),
       owner(owner), map_epoch(e) {}
 
@@ -142,7 +142,7 @@ public:
   unsigned get_priority() const { return priority; }
   int get_cost() const { return cost; }
   utime_t get_start_time() const { return start_time; }
-  entity_inst_t get_owner() const { return owner; }
+  uint64_t get_owner() const { return owner; }
   epoch_t get_map_epoch() const { return map_epoch; }
   const QVariant& get_variant() const { return qvariant; }
 }; // struct PGQueueable
index 4a4a7b5f74450ef1eb1b07bace0285782b73434b..3d8824914eb3a3ceb6fc42713ce47650fc125cfa 100644 (file)
@@ -29,7 +29,7 @@
 namespace ceph {
 
   using Request = std::pair<spg_t, PGQueueable>;
-  using Client = entity_inst_t;
+  using Client = uint64_t;
 
 
   // This class exists to bridge the ceph code, which treats the class
@@ -41,7 +41,7 @@ namespace ceph {
     enum class osd_op_type_t {
       client_op, osd_subop, bg_snaptrim, bg_recovery, bg_scrub };
 
-    using InnerClient = std::pair<entity_inst_t,osd_op_type_t>;
+    using InnerClient = std::pair<uint64_t,osd_op_type_t>;
 
     using queue_t = mClockQueue<Request, InnerClient>;
 
index d12c49a0d4ad27c3df144e65a19dedd1e7c6f50e..6b87335b10946f16e861c7f0f6d9fd5b6f60212e 100644 (file)
@@ -29,7 +29,7 @@
 namespace ceph {
 
   using Request = std::pair<spg_t, PGQueueable>;
-  using Client = entity_inst_t;
+  using Client = uint64_t;
 
 
   // This class exists to bridge the ceph code, which treats the class