From a25d097271c77c8858678f2e0fca67b896624ef2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 25 Mar 2021 12:04:37 +0800 Subject: [PATCH] osd/PeeringState: init last_require_osd_release in ctor so we can use the latest osdmap to tell what is the required osd release in *current* cluster before consuming a new osdmap which is fed to PeeringState only if we advance to a new map. a osd shares its pg_info using MOSDPGInfo2 or MOSDPGInfo according to PeeringState::last_require_osd_release, this happens before a new osdmap is fully consumed. Signed-off-by: Kefu Chai --- src/osd/PeeringState.cc | 1 + src/osd/PeeringState.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 570ebb8b86e..4d3428976df 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -120,6 +120,7 @@ PeeringState::PeeringState( pg_whoami(pg_whoami), info(spgid), pg_log(cct), + last_require_osd_release(curmap->require_osd_release), missing_loc(spgid, this, dpp, cct), machine(this, cct, spgid, dpp, pl, &state_history) { diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index 946aafe1b25..a314a8d53ba 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -1466,7 +1466,7 @@ public: uint64_t upacting_features = CEPH_FEATURES_SUPPORTED_DEFAULT; /// most recently consumed osdmap's require_osd_version - ceph_release_t last_require_osd_release = ceph_release_t::unknown; + ceph_release_t last_require_osd_release; std::vector want_acting; ///< non-empty while peering needs a new acting set -- 2.39.5