OPTION(keyvaluestore_op_thread_timeout, OPT_INT, 60)
OPTION(keyvaluestore_op_thread_suicide_timeout, OPT_INT, 180)
OPTION(keyvaluestore_default_strip_size, OPT_INT, 4096) // Only affect new object
+OPTION(keyvaluestore_max_expected_write_size, OPT_U64, 1ULL << 24) // bytes
// max bytes to search ahead in journal searching for corruption
OPTION(journal_max_corrupt_search, OPT_U64, 10<<20)
m_keyvaluestore_queue_max_ops(g_conf->keyvaluestore_queue_max_ops),
m_keyvaluestore_queue_max_bytes(g_conf->keyvaluestore_queue_max_bytes),
m_keyvaluestore_strip_size(g_conf->keyvaluestore_default_strip_size),
+ m_keyvaluestore_max_expected_write_size(g_conf->keyvaluestore_max_expected_write_size),
do_update(do_update)
{
ostringstream oss;
// Now only consider to change "strip_size" when the object is blank,
// because set_alloc_hint is expected to be very lightweight<O(1)>
if (blank) {
- header->strip_size = expected_write_size;
+ header->strip_size = MIN(expected_write_size, m_keyvaluestore_max_expected_write_size);
+ dout(20) << __func__ << " hint " << header->strip_size << " success" << dendl;
}
dout(10) << __func__ << "" << cid << "/" << oid << " object_size "
const std::set <std::string> &changed)
{
if (changed.count("keyvaluestore_queue_max_ops") ||
- changed.count("keyvaluestore_queue_max_bytes")) {
+ changed.count("keyvaluestore_queue_max_bytes") ||
+ changed.count("keyvaluestore_max_expected_write_size")) {
m_keyvaluestore_queue_max_ops = conf->keyvaluestore_queue_max_ops;
m_keyvaluestore_queue_max_bytes = conf->keyvaluestore_queue_max_bytes;
+ m_keyvaluestore_max_expected_write_size = conf->keyvaluestore_max_expected_write_size;
}
if (changed.count("keyvaluestore_default_strip_size")) {
m_keyvaluestore_strip_size = conf->keyvaluestore_default_strip_size;
int m_keyvaluestore_queue_max_ops;
int m_keyvaluestore_queue_max_bytes;
int m_keyvaluestore_strip_size;
-
+ uint64_t m_keyvaluestore_max_expected_write_size;
int do_update;
-
static const string OBJECT_STRIP_PREFIX;
static const string OBJECT_XATTR;
static const string OBJECT_OMAP;