From 3b9da1e457c1d7db82d6af9839310998265ff4a6 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Fri, 28 Feb 2020 12:27:12 +0800 Subject: [PATCH] crimson/osd: fix load_pg() during initialization fix a regression introduced by 80ac50f which dropped PG::read_state() incorrectly. Signed-off-by: Yingxin Cheng --- src/crimson/osd/osd.cc | 4 +++- src/crimson/osd/pg.cc | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index c65d909a139..f854f357f4a 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -530,7 +530,9 @@ seastar::future> OSD::load_pg(spg_t pgid) }).then([pgid, this] (auto&& create_map) { return make_pg(std::move(create_map), pgid, false); }).then([this, pgid](Ref pg) { - return seastar::make_ready_future>(std::move(pg)); + return pg->read_state(store.get()).then([pg] { + return seastar::make_ready_future>(std::move(pg)); + }); }).handle_exception([pgid](auto ep) { logger().info("pg {} saw exception on load {}", pgid, ep); ceph_abort("Could not load pg" == 0); diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index 37f7535d406..4a60f385cbb 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -363,10 +363,8 @@ void PG::init( seastar::future<> PG::read_state(crimson::os::FuturizedStore* store) { - return store->open_collection(coll_t(pgid)).then([this, store](auto ch) { - coll_ref = ch; - return PGMeta{store, pgid}.load(); - }).then([this, store](pg_info_t pg_info, PastIntervals past_intervals) { + return PGMeta{store, pgid}.load( + ).then([this, store](pg_info_t pg_info, PastIntervals past_intervals) { return peering_state.init_from_disk_state( std::move(pg_info), std::move(past_intervals), -- 2.47.3