]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: reset pending_inc after applying it
authorKefu Chai <kchai@redhat.com>
Mon, 29 May 2017 16:40:25 +0000 (00:40 +0800)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:06:47 +0000 (13:06 -0400)
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 <kchai@redhat.com>
src/mgr/ClusterState.cc

index 3ca97499cd9ae3e5c72ef2a8cb117b4a9cf16720..60612cb90b500a6db5f593119ed21475117642a8 100644 (file)
@@ -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.