]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PG: only correct filestore collection bits on load
authorSage Weil <sage@redhat.com>
Fri, 7 Apr 2017 13:50:12 +0000 (09:50 -0400)
committerSage Weil <sage@redhat.com>
Fri, 7 Apr 2017 13:50:12 +0000 (09:50 -0400)
PG::update_store_with_options() is called on load *and* when the pool
properties change, but if we only need to fix bits right at load time.
More importantly, but doing a second check on pool change, we may race
with a previously queued collection create that is not yet readable via
filestore, try to (synchronously) set the property again, and deadlock.

Fixes: http://tracker.ceph.com/issues/19541
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h

index a52a339d0166d7e55eee6de020753747ac61e1de..6a3d3a285ffa813b1c0155090b82aa4db531be5f 100644 (file)
@@ -5850,7 +5850,10 @@ void PG::update_store_with_options()
   if(r < 0 && r != -EOPNOTSUPP) {
     derr << __func__ << "set_collection_opts returns error:" << r << dendl;
   }
+}
 
+void PG::update_store_on_load()
+{
   if (osd->store->get_type() == "filestore") {
     // legacy filestore didn't store collection bit width; fix.
     int bits = osd->store->collection_bits(coll);
@@ -5907,6 +5910,8 @@ boost::statechart::result PG::RecoveryState::Initial::react(const Load& l)
   pg->send_notify = (!pg->is_primary());
   pg->update_store_with_options();
 
+  pg->update_store_on_load();
+
   return transit< Reset >();
 }
 
index bbfb037257b6c066269fce3d1b8616133c133a56..4763859d66b9adb3868fef21966fa16761b9dcd8 100644 (file)
@@ -2242,6 +2242,7 @@ private:
   void prepare_write_info(map<string,bufferlist> *km);
 
   void update_store_with_options();
+  void update_store_on_load();
 
 public:
   static int _prepare_write_info(