]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: read kb stats not tracked?
authorDavid Zafman <david.zafman@inktank.com>
Sat, 27 Apr 2013 01:05:18 +0000 (18:05 -0700)
committerDavid Zafman <david.zafman@inktank.com>
Tue, 30 Apr 2013 00:46:15 +0000 (17:46 -0700)
In read cases track stats in PG::unstable_stats
Include unstable_stats in write_info() and publish_stats_to_osd()
For now this information may not get persisted

fixes: #2209

Signed-off-by: David Zafman <david.zafman@inktank.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedPG.cc

index 3ddbe93d51df8dd867c0bab8d4d6970ed34c68ee..ae88be652daa4ab90352c7faccf464e47a3174ce 100644 (file)
@@ -2341,6 +2341,7 @@ void PG::publish_stats_to_osd()
 
     pg_stats_publish_valid = true;
     pg_stats_publish = info.stats;
+    pg_stats_publish.stats.add(unstable_stats);
 
     // calc copies, degraded
     unsigned target = MAX(get_osdmap()->get_pg_size(info.pgid), acting.size());
@@ -2620,6 +2621,9 @@ int PG::_write_info(ObjectStore::Transaction& t, epoch_t epoch,
 
 void PG::write_info(ObjectStore::Transaction& t)
 {
+  info.stats.stats.add(unstable_stats);
+  unstable_stats.clear();
+
   int ret = _write_info(t, get_osdmap()->get_epoch(), info, coll,
      past_intervals, snap_collections, osd->infos_oid,
      info_struct_v, dirty_big_info);
index f74814db8694fecf92ac97a85cbf138ad3fe22e9..9f10d8dfbd0ec127a432882697d1126c1ba7f6f3 100644 (file)
@@ -716,6 +716,9 @@ protected:
   void requeue_object_waiters(map<hobject_t, list<OpRequestRef> >& m);
   void requeue_ops(list<OpRequestRef> &l);
 
+  // stats that persist lazily
+  object_stat_collection_t unstable_stats;
+
   // publish stats
   Mutex pg_stats_publish_lock;
   bool pg_stats_publish_valid;
index 83b4db491b785645f494d2711911615d8c5fe8c3..531fa5d91fa9f5e46539dae351cfdcc57908f09c 100644 (file)
@@ -3575,6 +3575,7 @@ int ReplicatedPG::prepare_transaction(OpContext *ctx)
   // read-op?  done?
   if (ctx->op_t.empty() && !ctx->modify) {
     ctx->reply_version = ctx->obs->oi.user_version;
+    unstable_stats.add(ctx->delta_stats, ctx->obc->obs.oi.category);
     return result;
   }
 
@@ -6335,6 +6336,7 @@ void ReplicatedPG::on_change()
   snap_trimmer_machine.process_event(Reset());
 
   debug_op_order.clear();
+  unstable_stats.clear();
 }
 
 void ReplicatedPG::on_role_change()