Merge pull request #15120 from liewegas/wip-ec-buffer

osd: reduce buffer pinning from EC entries

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Sage Weil 2017-05-18 13:28:02 -05:00 committed by GitHub
commit 5a03220dda
6 changed files with 13 additions and 10 deletions

View File

@ -378,6 +378,7 @@ OPTION(mon_debug_dump_transactions, OPT_BOOL, false)
OPTION(mon_debug_dump_json, OPT_BOOL, false)
OPTION(mon_debug_dump_location, OPT_STR, "/var/log/ceph/$cluster-$name.tdump")
OPTION(mon_debug_no_require_luminous, OPT_BOOL, false)
OPTION(mon_debug_no_require_bluestore_for_ec_overwrites, OPT_BOOL, false)
OPTION(mon_inject_transaction_delay_max, OPT_DOUBLE, 10.0) // seconds
OPTION(mon_inject_transaction_delay_probability, OPT_DOUBLE, 0) // range [0, 1]

View File

@ -5994,7 +5994,8 @@ int OSDMonitor::prepare_command_pool_set(map<string,cmd_vartype> &cmdmap,
return -EINVAL;
}
stringstream err;
if (!is_pool_currently_all_bluestore(pool, p, &err)) {
if (!g_conf->mon_debug_no_require_bluestore_for_ec_overwrites &&
!is_pool_currently_all_bluestore(pool, p, &err)) {
ss << "pool must only be stored on bluestore for scrubbing to work: " << err.str();
return -EINVAL;
}

View File

@ -166,10 +166,9 @@ void ECTransaction::generate_transactions(
if (entry &&
entry->is_modify() &&
op.updated_snaps) {
vector<snapid_t> snaps(
op.updated_snaps->second.begin(),
op.updated_snaps->second.end());
::encode(snaps, entry->snaps);
bufferlist bl(op.updated_snaps->second.size() * 8 + 8);
::encode(op.updated_snaps->second, bl);
entry->snaps.swap(bl);
}
ldpp_dout(dpp, 20) << "generate_transactions: "

View File

@ -440,6 +440,9 @@ public:
assert(get_can_rollback_to() == head);
}
// make sure our buffers don't pin bigger buffers
e.mod_desc.trim_bl();
// add to log
log.push_back(e);

View File

@ -358,10 +358,9 @@ void generate_transaction(
le.mark_unrollbackable();
auto oiter = pgt->op_map.find(le.soid);
if (oiter != pgt->op_map.end() && oiter->second.updated_snaps) {
vector<snapid_t> snaps(
oiter->second.updated_snaps->second.begin(),
oiter->second.updated_snaps->second.end());
::encode(snaps, le.snaps);
bufferlist bl(oiter->second.updated_snaps->second.size() * 8 + 8);
::encode(oiter->second.updated_snaps->second, bl);
le.snaps.swap(bl);
}
}

View File

@ -3238,7 +3238,7 @@ public:
* in the case that bl contains ptrs which point into a much larger
* message buffer
*/
void trim_bl() {
void trim_bl() const {
if (bl.length() > 0)
bl.rebuild();
}