From: fangyuxiang Date: Thu, 22 Dec 2016 02:43:27 +0000 (+0800) Subject: ReplicatedBackend: do not set omap header if it is empty X-Git-Tag: v12.0.0~352^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F12612%2Fhead;p=ceph.git ReplicatedBackend: do not set omap header if it is empty In replicatedpg backfill, objects have no omap header or keys previously, but an empty omap header will be inserted when they are pushed to replica, which leads leveldb performance degrade seriously when cluster has huge number of objects. so my opinion is that we does't insert omap header if is size is zero when handle PushOp in recovery. Signed-off-by: fang yuxiang --- diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index c051db8828ef..6077bca922ab 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -1669,7 +1669,8 @@ void ReplicatedBackend::submit_push_data( t->remove(coll, ghobject_t(target_oid)); t->touch(coll, ghobject_t(target_oid)); t->truncate(coll, ghobject_t(target_oid), recovery_info.size); - t->omap_setheader(coll, ghobject_t(target_oid), omap_header); + if (omap_header.length()) + t->omap_setheader(coll, ghobject_t(target_oid), omap_header); bufferlist bv = attrs[OI_ATTR]; object_info_t oi(bv);