提交 1a61ba17 编写于 作者: J Jay Patel 提交者: Facebook Github Bot

compaction picker to use max_bytes_for_level_multiplier_additional

Summary:
Hi,
As part of some optimization, we're using multiple DB locations (tmpfs and spindle) to store data and configured max_bytes_for_level_multiplier_additional. But, max_bytes_for_level_multiplier_additional is not used to compute the actual size for the level while picking the DB location. So, even if DB location does not have space, RocksDB mistakenly puts the level at that location.

Can someone pls. verify the fix? Let me know any other changes required.

Thanks,
Jay
Closes https://github.com/facebook/rocksdb/pull/2704

Differential Revision: D5992515

Pulled By: ajkr

fbshipit-source-id: cbbc6c0e0a7dbdca91c72e0f37b218c4cec57e28
上级 e2548366
......@@ -1281,9 +1281,20 @@ uint32_t LevelCompactionBuilder::GetPathId(
} else {
current_path_size -= level_size;
if (cur_level > 0) {
level_size = static_cast<uint64_t>(
if (ioptions.level_compaction_dynamic_level_bytes) {
// Currently, level_compaction_dynamic_level_bytes is ignored when
// multiple db paths are specified. https://github.com/facebook/
// rocksdb/blob/master/db/column_family.cc.
// Still, adding this check to avoid accidentally using
// max_bytes_for_level_multiplier_additional
level_size = static_cast<uint64_t>(
level_size * mutable_cf_options.max_bytes_for_level_multiplier);
}
} else {
level_size = static_cast<uint64_t>(
level_size * mutable_cf_options.max_bytes_for_level_multiplier
* mutable_cf_options.MaxBytesMultiplerAdditional(cur_level));
}
}
cur_level++;
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册