From: Sage Weil Date: Wed, 9 Apr 2014 00:28:54 +0000 (-0700) Subject: osd: do not block when updating osdmap superblock features X-Git-Tag: v0.80-rc1~73^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1631%2Fhead;p=ceph.git osd: do not block when updating osdmap superblock features 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index a6ab1de791bc..91d4887a3999 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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(); }