From aad1afcb96de1483ecaf93adf473d5732246ea7a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 30 May 2017 00:40:25 +0800 Subject: [PATCH] mgr: reset pending_inc after applying it we cannot apply pending_inc twice and expect the result is the same. in other words, pg_map.apply_incremental(pending_inc) is not an idempotent operation. Signed-off-by: Kefu Chai --- src/mgr/ClusterState.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mgr/ClusterState.cc b/src/mgr/ClusterState.cc index 3ca97499cd9ae..60612cb90b500 100644 --- a/src/mgr/ClusterState.cc +++ b/src/mgr/ClusterState.cc @@ -96,6 +96,7 @@ void ClusterState::update_delta_stats() pending_inc.version = pg_map.version + 1; // to make apply_incremental happy dout(10) << " v" << pending_inc.version << dendl; pg_map.apply_incremental(g_ceph_context, pending_inc); + pending_inc = PGMap::Incremental(); } void ClusterState::notify_osdmap(const OSDMap &osd_map) @@ -122,7 +123,7 @@ void ClusterState::notify_osdmap(const OSDMap &osd_map) need_check_down_pg_osds, &pending_inc); pg_map.apply_incremental(g_ceph_context, pending_inc); - + pending_inc = PGMap::Incremental(); // TODO: Complete the separation of PG state handling so // that a cut-down set of functionality remains in PGMonitor // while the full-blown PGMap lives only here. -- 2.39.5