]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: set correctly shard for existed Collection. 22860/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Tue, 3 Jul 2018 07:11:07 +0000 (15:11 +0800)
committerNathan Cutler <ncutler@suse.com>
Wed, 4 Jul 2018 23:01:32 +0000 (01:01 +0200)
For existed Collection, the constructor of Collection will be called in _open_collections.
But m_finisher_num can't setup when enable bluestore_shard_finishers.

So move m_finisher_num setup before _open_collections && _kv_start.

Fixes: http://tracker.ceph.com/issues/24761
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
(cherry picked from commit 42cd25b794d2a2c04e96a24abea7f773bb7a3c2e)

src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 6fdd11b170b2403af505c2cf68717d686314893f..71e92d19f65bd8e077ada0354d3ad00cca32b4ab 100644 (file)
@@ -3729,6 +3729,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);
@@ -7720,6 +7737,8 @@ int BlueStore::_open_super_meta()
   _set_compression();
   _set_blob_size();
 
+  _set_finisher_num();
+
   return 0;
 }
 
@@ -8348,21 +8367,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;
index 387c22373243ba6c038d45dfb59d12081ec29f1c..836bc01b827bf8dfb63609d2c46ee8d761c9b701 100644 (file)
@@ -1970,6 +1970,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();