From 22a0c1fd5e44e22930b7316cdb9c9d0f531c9d95 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 8 Apr 2014 17:28:54 -0700 Subject: [PATCH] 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 --- src/osd/OSD.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index a6ab1de791bce..91d4887a39993 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(); } -- 2.39.5