Merge pull request #9894 from gaowanlong/osd_recovery_max_omap_entries_per_chunk

osd: limit omap data in push op

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
Yuri Weinstein 2016-07-26 15:38:10 -07:00 committed by GitHub
commit 38609de1ec
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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()));