]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: improve debug output on snap collections
authorSage Weil <sage@inktank.com>
Sun, 10 Feb 2013 18:57:12 +0000 (10:57 -0800)
committerSamuel Just <sam.just@inktank.com>
Tue, 19 Mar 2013 17:30:00 +0000 (10:30 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
(cherry picked from commit 8b05492ca5f1479589bb19c1ce058b0d0988b74f)

src/osd/ReplicatedPG.cc
src/osd/osd_types.cc

index 938715dbf08b2653457475438c7339bb30f11cb3..3e75fe2c7dca42ad91ac270228d4b014ac35df22 100644 (file)
@@ -1438,7 +1438,7 @@ ReplicatedPG::RepGather *ReplicatedPG::trim_object(const hobject_t &coid,
 
     dout(10) << "removing coid " << coid << " from snap collections "
             << to_remove << " and adding to snap collections "
-            << to_create << dendl;
+            << to_create << " for final snaps " << coi.snaps << dendl;
 
     ctx->log.push_back(pg_log_entry_t(pg_log_entry_t::MODIFY, coid, coi.version, coi.prior_version,
                                  osd_reqid_t(), ctx->mtime));
index 97b23e35d92f959ec55cdf4313f80b0297ba3ba5..ce28235ee9fbeda6162bf2f6ec32ce532d5a613f 100644 (file)
@@ -1781,8 +1781,20 @@ void pg_log_entry_t::generate_test_instances(list<pg_log_entry_t*>& o)
 
 ostream& operator<<(ostream& out, const pg_log_entry_t& e)
 {
-  return out << e.version << " (" << e.prior_version << ") "
-             << e.get_op_name() << ' ' << e.soid << " by " << e.reqid << " " << e.mtime;
+  out << e.version << " (" << e.prior_version << ") "
+      << e.get_op_name() << ' ' << e.soid << " by " << e.reqid << " " << e.mtime;
+  if (e.snaps.length()) {
+    vector<snapid_t> snaps;
+    bufferlist c = e.snaps;
+    bufferlist::iterator p = c.begin();
+    try {
+      ::decode(snaps, p);
+    } catch (...) {
+      snaps.clear();
+    }
+    out << " snaps " << snaps;
+  }
+  return out;
 }