]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: dump transaction to log if we hit an error
authorSage Weil <sage@newdream.net>
Tue, 13 Dec 2011 17:07:36 +0000 (09:07 -0800)
committerSage Weil <sage@newdream.net>
Tue, 13 Dec 2011 17:15:23 +0000 (09:15 -0800)
This will let us see which operation in the transaction failed.

Signed-off-by: Sage Weil <sage@newdream.net>
src/os/FileStore.cc

index 36696a893b8aa7cae1ceaa95a96e7db03be5909b..0cc89f02b39fec5c85e48177a1c9a8a2fd8b17fa 100644 (file)
@@ -2159,8 +2159,10 @@ unsigned FileStore::_do_transaction(Transaction& t, uint64_t op_seq)
 
   Transaction::iterator i = t.begin();
 
+  int op_num = 0;
   while (i.have_op()) {
     int op = i.get_op();
+    op_num++;
     int r = 0;
     switch (op) {
     case Transaction::OP_NOP:
@@ -2410,7 +2412,11 @@ unsigned FileStore::_do_transaction(Transaction& t, uint64_t op_seq)
       dout(10) << "tolerating EEXIST during journal replay since btrfs_snap is not enabled" << dendl;
     }
     else if (r < 0) {
-      dout(0) << " error " << cpp_strerror(r) << " not handled" << dendl;
+      dout(0) << " error " << cpp_strerror(r) << " not handled on operation " << op
+             << " (op num " << op_num << ", counting from 1)" << dendl;
+      dout(0) << " transaction dump:\n";
+      t.dump(*_dout);
+      *_dout << dendl;
       assert(0 == "unexpected error");
     }
   }