Skip to content

Commit

Permalink
Merge pull request #12417: hammer: osd: ReplicatedBackend::build_push…
Browse files Browse the repository at this point in the history
…_op: add a second config to limit omap entries/chunk independently of object data

Reviewed-by: Nathan Cutler <ncutler@suse.com>
  • Loading branch information
smithfarm committed Dec 14, 2016
2 parents 898e441 + fe77c9a commit ffffc8d
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 @@ -616,6 +616,7 @@ OPTION(osd_recovery_delay_start, OPT_FLOAT, 0)
OPTION(osd_recovery_max_active, OPT_INT, 15)
OPTION(osd_recovery_max_single_start, OPT_INT, 5)
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 @@ -2033,7 +2033,9 @@ int ReplicatedBackend::build_push_op(const ObjectRecoveryInfo &recovery_info,
iter->valid();
iter->next()) {
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 ffffc8d

Please sign in to comment.