Skip to content

Commit

Permalink
ReplicatedBackend: do not set omap header if it is empty
Browse files Browse the repository at this point in the history
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 <fang.yuxiang@eisoo.com>
  • Loading branch information
fangyuxiangGL committed Dec 27, 2016
1 parent af21f0d commit c0ddd39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/osd/ReplicatedBackend.cc
Expand Up @@ -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);
Expand Down

0 comments on commit c0ddd39

Please sign in to comment.