]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: pass updated stats to replica
authorSage Weil <sage@newdream.net>
Fri, 19 Jun 2009 19:45:36 +0000 (12:45 -0700)
committerSage Weil <sage@newdream.net>
Fri, 19 Jun 2009 19:45:36 +0000 (12:45 -0700)
When we ship the raw transaction to the replica, we need to ship the
new pg_stat_t as well, since that isn't getting updated in parallel by
prepare_transaction().

src/include/ceph_fs.h
src/messages/MOSDSubOp.h
src/osd/ReplicatedPG.cc

index 14435667eaed3dd7eb00c9bceb66bfca7bbe0ad4..c9507ffc45f1ff236113f5ae2f14a8a975292d7e 100644 (file)
@@ -23,7 +23,7 @@
  * internal cluster protocols separately from the public,
  * client-facing protocol.
  */
-#define CEPH_OSD_PROTOCOL     5 /* cluster internal */
+#define CEPH_OSD_PROTOCOL     6 /* cluster internal */
 #define CEPH_MDS_PROTOCOL     9 /* cluster internal */
 #define CEPH_MON_PROTOCOL     4 /* cluster internal */
 #define CEPH_OSDC_PROTOCOL   18 /* public/client */
index 9109ddf674671d969f8e68436f7d1d2ef38a4f66..63a172fad8a08754a6e7e0a0e0fa9b9b58a1df05 100644 (file)
@@ -50,6 +50,7 @@ public:
 
   // transaction to exec
   bufferlist logbl;
+  pg_stat_t pg_stats;
   
   // subop metadata
   tid_t rep_tid;
@@ -91,6 +92,7 @@ public:
     ::decode(snapset, p);
     ::decode(snapc, p);
     ::decode(logbl, p);
+    ::decode(pg_stats, p);
     ::decode(pg_trim_to, p);
     ::decode(peer_stat, p);
     ::decode(attrset, p);
@@ -122,6 +124,7 @@ public:
     ::encode(snapset, payload);
     ::encode(snapc, payload);
     ::encode(logbl, payload);
+    ::encode(pg_stats, payload);
     ::encode(pg_trim_to, payload);
     ::encode(peer_stat, payload);
     ::encode(attrset, payload);
index 045d3327a47bb990b507e466c0907811c6df6674..33271d8f0776b1b55e6b7a16f5d1dee6b4199ed9 100644 (file)
@@ -1678,10 +1678,11 @@ void ReplicatedPG::issue_repop(RepGather *repop, int dest, utime_t now,
     wr->snapc = repop->ctx->snapc;
     wr->get_data() = repop->ctx->op->get_data();   // _copy_ bufferlist
   } else {
-    // ship resulting transaction and log entries
+    // ship resulting transaction, log entries, and pg_stats
     wr->ops = repop->ctx->ops;   // just fyi
     ::encode(repop->ctx->op_t, wr->get_data());
     ::encode(repop->ctx->log, wr->logbl);
+    wr->pg_stats = info.stats;
   }
 
   wr->pg_trim_to = pg_trim_to;
@@ -2084,6 +2085,7 @@ void ReplicatedPG::sub_op_modify(MOSDSubOp *op)
       p = op->logbl.begin();
       ::decode(log, p);
       
+      info.stats = op->pg_stats;
       log_op(log, op->pg_trim_to, localt);
 
       tls.push_back(&opt);