]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: set correctly shard for existed Collection. 22859/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:00:48 +0000 (01:00 +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 e205baff3d61d5b8c69fbf007d6610022ca8a4f7..e1bbfbef46decfda364d58a248584eeafbd5a4fb 100644 (file)
@@ -3880,6 +3880,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);
@@ -8263,6 +8280,8 @@ int BlueStore::_open_super_meta()
   _set_compression();
   _set_blob_size();
 
+  _set_finisher_num();
+
   return 0;
 }
 
@@ -8853,21 +8872,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 9a9b56d1df7f447d3f500533c12f3db7771f217d..60d6908321c94b49005052e52edab205535f0a19 100644 (file)
@@ -1966,6 +1966,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();