]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PG: implement pool options pass to object store.
authorIgor Fedotov <ifedotov@mirantis.com>
Mon, 12 Sep 2016 15:18:24 +0000 (18:18 +0300)
committerIgor Fedotov <ifedotov@mirantis.com>
Wed, 19 Oct 2016 14:33:29 +0000 (14:33 +0000)
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
src/os/bluestore/BlueStore.cc
src/osd/PG.cc
src/osd/PG.h

index 40e1e50c35c596e0e8126fafe9a3a98d6041faf5..179475364356b5e1e5eebbcaf11fed2335338fa9 100644 (file)
@@ -7946,9 +7946,9 @@ int BlueStore::_do_write(
         "compression_max_blob_size",
         comp_max_blob_size.load(), 
         [&]() {
-          uint64_t val;
+          int val;
           if(c->pool_opts.get(pool_opts_t::COMPRESSION_MAX_BLOB_SIZE, &val)) {
-           return boost::optional<uint64_t>(val);
+           return boost::optional<uint64_t>((uint64_t)val);
           }
           return boost::optional<uint64_t>();
         }
@@ -7960,9 +7960,9 @@ int BlueStore::_do_write(
         "compression_min_blob_size",
         comp_min_blob_size.load(), 
         [&]() {
-          uint64_t val;
+          int val;
           if(c->pool_opts.get(pool_opts_t::COMPRESSION_MIN_BLOB_SIZE, &val)) {
-           return boost::optional<uint64_t>(val);
+           return boost::optional<uint64_t>((uint64_t)val);
           }
           return boost::optional<uint64_t>();
         }
index 5557e41eea9891a0c3a94d6bcbf507912b7039df..2945f76ad36b21d4666d3bd18460dc3dc6a3250c 100644 (file)
@@ -5614,8 +5614,10 @@ void PG::handle_advance_map(
     osdmap, lastmap, newup, up_primary,
     newacting, acting_primary);
   recovery_state.handle_event(evt, rctx);
-  if (pool.info.last_change == osdmap_ref->get_epoch())
+  if (pool.info.last_change == osdmap_ref->get_epoch()) {
     on_pool_change();
+    update_store_with_options();
+  }
 }
 
 void PG::handle_activate_map(RecoveryCtx *rctx)
@@ -5661,7 +5663,13 @@ void PG::handle_query_state(Formatter *f)
   recovery_state.handle_event(q, 0);
 }
 
-
+void PG::update_store_with_options()
+{
+  auto r = osd->store->set_collection_opts(coll, pool.info.opts);
+  if(r < 0 && r != -EOPNOTSUPP) {
+    derr << __func__ << "set_collection_opts returns error:" << r << dendl;
+  }
+}
 
 std::ostream& operator<<(std::ostream& oss,
                         const struct PG::PriorSet &prior)
@@ -5701,6 +5709,7 @@ boost::statechart::result PG::RecoveryState::Initial::react(const Load& l)
 
   // do we tell someone we're here?
   pg->send_notify = (!pg->is_primary());
+  pg->update_store_with_options();
 
   return transit< Reset >();
 }
index 9f53362a6c4ba07bba628db62029fc3146be17f6..3bd89bb8c30b823ef44e80d3063962618aa0d808 100644 (file)
@@ -2234,6 +2234,8 @@ public:
 private:
   void prepare_write_info(map<string,bufferlist> *km);
 
+  void update_store_with_options();
+
 public:
   static int _prepare_write_info(
     map<string,bufferlist> *km,