@@ -1774,7 +1774,8 @@ int OSD::read_superblock()
-void OSD::recursive_remove_collection(ObjectStore *store, coll_t tmp)
+void OSD::recursive_remove_collection(ObjectStore *store, coll_t tmp,
+ bool flush)
{
OSDriver driver(
store,
@@ -1810,7 +1811,8 @@ void OSD::recursive_remove_collection(ObjectStore *store, coll_t tmp)
t.remove_collection(tmp);
int r = store->apply_transaction(t);
assert(r == 0);
- store->sync_and_flush();
+ if (flush)
+ store->sync_and_flush();
}
@@ -2046,6 +2048,7 @@ void OSD::load_pgs()
set<spg_t> head_pgs;
map<spg_t, interval_set<snapid_t> > pgs;
+ bool flush = false;
for (vector<coll_t>::iterator it = ls.begin();
it != ls.end();
++it) {
@@ -2056,7 +2059,8 @@ void OSD::load_pgs()
if (it->is_temp(pgid) ||
it->is_removal(&seq, &pgid)) {
dout(10) << "load_pgs " << *it << " clearing temp" << dendl;
- recursive_remove_collection(store, *it);
+ recursive_remove_collection(store, *it, false);
+ flush = true;
continue;
}
@@ -2074,6 +2078,8 @@ void OSD::load_pgs()
dout(10) << "load_pgs ignoring unrecognized " << *it << dendl;
}
+ if (flush)
+ store->sync_and_flush();
bool has_upgraded = false;
for (map<spg_t, interval_set<snapid_t> >::iterator i = pgs.begin();
@@ -870,7 +870,8 @@ public:
hobject_t oid(sobject_t("infos", CEPH_NOSNAP));
return oid;
}
- static void recursive_remove_collection(ObjectStore *store, coll_t tmp);
+ static void recursive_remove_collection(ObjectStore *store, coll_t tmp,
+ bool flush = true);
/**
* get_osd_initial_compat_set()