From: Kefu Chai Date: Mon, 29 May 2017 16:40:25 +0000 (+0800) Subject: mgr: reset pending_inc after applying it X-Git-Tag: ses5-milestone6~8^2~19^2~19 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aad1afcb96de1483ecaf93adf473d5732246ea7a;p=ceph.git 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 --- diff --git a/src/mgr/ClusterState.cc b/src/mgr/ClusterState.cc index 3ca97499cd9a..60612cb90b50 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.