Merge PR #22733 into master

* refs/pull/22733/head:
	os/bluestore: set correctly shard for existed Collection.

Reviewed-by: Igor Fedotov <ifedotov@suse.com>
This commit is contained in:
Sage Weil 2018-07-04 14:22:08 -05:00
commit 7895d5b746
2 changed files with 20 additions and 15 deletions

View File

@ -3983,6 +3983,23 @@ void BlueStore::_set_blob_size()
<< std::dec << dendl;
}
void BlueStore::_set_finisher_num()
{
if (cct->_conf->bluestore_shard_finishers) {
if (cct->_conf->osd_op_num_shards) {
m_finisher_num = cct->_conf->osd_op_num_shards;
} else {
assert(bdev);
if (bdev->is_rotational()) {
m_finisher_num = cct->_conf->osd_op_num_shards_hdd;
} else {
m_finisher_num = cct->_conf->osd_op_num_shards_ssd;
}
}
}
assert(m_finisher_num != 0);
}
int BlueStore::_set_cache_sizes()
{
assert(bdev);
@ -8341,6 +8358,8 @@ int BlueStore::_open_super_meta()
_set_compression();
_set_blob_size();
_set_finisher_num();
return 0;
}
@ -8935,21 +8954,6 @@ void BlueStore::_kv_start()
{
dout(10) << __func__ << dendl;
if (cct->_conf->bluestore_shard_finishers) {
if (cct->_conf->osd_op_num_shards) {
m_finisher_num = cct->_conf->osd_op_num_shards;
} else {
assert(bdev);
if (bdev->is_rotational()) {
m_finisher_num = cct->_conf->osd_op_num_shards_hdd;
} else {
m_finisher_num = cct->_conf->osd_op_num_shards_ssd;
}
}
}
assert(m_finisher_num != 0);
for (int i = 0; i < m_finisher_num; ++i) {
ostringstream oss;
oss << "finisher-" << i;

View File

@ -2082,6 +2082,7 @@ private:
void _close_fsid();
void _set_alloc_sizes();
void _set_blob_size();
void _set_finisher_num();
int _open_bdev(bool create);
void _close_bdev();