Skip to content

Commit

Permalink
Merge pull request #9894 from gaowanlong/osd_recovery_max_omap_entrie…
Browse files Browse the repository at this point in the history
…s_per_chunk

osd: limit omap data in push op

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Samuel Just <sjust@redhat.com>
  • Loading branch information
yuriw committed Jul 26, 2016
2 parents a6c0952 + 56064c5 commit 38609de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/common/config_opts.h
Expand Up @@ -754,6 +754,7 @@ OPTION(osd_recovery_delay_start, OPT_FLOAT, 0)
OPTION(osd_recovery_max_active, OPT_U64, 3)
OPTION(osd_recovery_max_single_start, OPT_U64, 1)
OPTION(osd_recovery_max_chunk, OPT_U64, 8<<20) // max size of push chunk
OPTION(osd_recovery_max_omap_entries_per_chunk, OPT_U64, 64000) // max number of omap entries per chunk; 0 to disable limit
OPTION(osd_copyfrom_max_chunk, OPT_U64, 8<<20) // max size of a COPYFROM chunk
OPTION(osd_push_per_object_cost, OPT_U64, 1000) // push cost per object
OPTION(osd_max_push_cost, OPT_U64, 8<<20) // max size of push message
Expand Down
4 changes: 3 additions & 1 deletion src/osd/ReplicatedBackend.cc
Expand Up @@ -2008,7 +2008,9 @@ int ReplicatedBackend::build_push_op(const ObjectRecoveryInfo &recovery_info,
iter->valid();
iter->next(false)) {
if (!out_op->omap_entries.empty() &&
available <= (iter->key().size() + iter->value().length()))
((cct->_conf->osd_recovery_max_omap_entries_per_chunk > 0 &&
out_op->omap_entries.size() >= cct->_conf->osd_recovery_max_omap_entries_per_chunk) ||
available <= iter->key().size() + iter->value().length()))
break;
out_op->omap_entries.insert(make_pair(iter->key(), iter->value()));

Expand Down

0 comments on commit 38609de

Please sign in to comment.