]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: avoid spurious omap_setkeys, setattrs during recovery
authorSage Weil <sage@redhat.com>
Thu, 22 Jan 2015 18:00:35 +0000 (10:00 -0800)
committerSage Weil <sage@redhat.com>
Fri, 19 Jun 2015 00:02:45 +0000 (17:02 -0700)
Only call these if we have values to set on this iteration.  This is
rarely true for omap.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ReplicatedBackend.cc

index 202121562b31b27c191af66824a7492bd6c46c5c..f2ee3b09f98a2bbc24c7349f7a65f8db1418b254 100644 (file)
@@ -1728,8 +1728,10 @@ void ReplicatedBackend::submit_push_data(
     off += p.get_len();
   }
 
-  t->omap_setkeys(target_coll, target_oid, omap_entries);
-  t->setattrs(target_coll, target_oid, attrs);
+  if (!omap_entries.empty())
+    t->omap_setkeys(target_coll, target_oid, omap_entries);
+  if (!attrs.empty())
+    t->setattrs(target_coll, target_oid, attrs);
 
   if (complete) {
     if (!first) {