]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
check to_remove before setting transaction 2805/head
authorxinxin shu <xinxin.shu@intel.com>
Sun, 26 Oct 2014 21:25:54 +0000 (05:25 +0800)
committerxinxin shu <xinxin.shu@intel.com>
Sun, 26 Oct 2014 21:26:05 +0000 (05:26 +0800)
currently if you dump transaction for a single rbd write, a transaction
of OMAP_RMKEYS will be listed even if to_remove is empty.

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
src/osd/PGLog.cc

index 60390a2a5962f4172161ebf1ee8be49850161434..65dfb800bcbc81d4bf8ee3146d7dcab5b4989cfd 100644 (file)
@@ -799,7 +799,8 @@ void PGLog::_write_log(
   }
   ::encode(log.can_rollback_to, keys["can_rollback_to"]);
 
-  t.omap_rmkeys(META_COLL, log_oid, to_remove);
+  if (to_remove.size())
+    t.omap_rmkeys(META_COLL, log_oid, to_remove);
   t.omap_setkeys(META_COLL, log_oid, keys);
 }