]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not block when updating osdmap superblock features 1631/head
authorSage Weil <sage@inktank.com>
Wed, 9 Apr 2014 00:28:54 +0000 (17:28 -0700)
committerSage Weil <sage@inktank.com>
Wed, 9 Apr 2014 00:28:54 +0000 (17:28 -0700)
We are holding osd_lock in check_osdmap_features, which means we cannot
block while waiting for filestore operations to flush/apply without
risking deadlock.

The important constraint is that we commit that the feature is enabled
before also commiting anything that utilizes sharded objects.  The normal
commit sequencing does that already; there is no reason to block here.

Fixes: #8045
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSD.cc

index a6ab1de791bce5cdd73c79fe8af564c215fd7969..91d4887a399932b2966dffebec4ed4e6f49847de 100644 (file)
@@ -5667,9 +5667,9 @@ void OSD::check_osdmap_features(ObjectStore *fs)
        !fs->get_allow_sharded_objects()) {
     dout(0) << __func__ << " enabling on-disk ERASURE CODES compat feature" << dendl;
     superblock.compat_features.incompat.insert(CEPH_OSD_FEATURE_INCOMPAT_SHARDS);
-    ObjectStore::Transaction t;
-    write_superblock(t);
-    int err = store->apply_transaction(t);
+    ObjectStore::Transaction *t = new ObjectStore::Transaction;
+    write_superblock(*t);
+    int err = store->queue_transaction_and_cleanup(NULL, t);
     assert(err == 0);
     fs->set_allow_sharded_objects();
   }