From ba3c6a055d462895dad4ac5f61af43d7a373a20a Mon Sep 17 00:00:00 2001 From: songbaisen Date: Mon, 10 Apr 2017 02:21:06 +0000 Subject: [PATCH] mon: fix synchronise pgmap with others leader mon down for a long time and then the local pgmap/osdmap was behind latest map a lot, when it start and sync ,it will read full map from other mons; if serveral osds/pgs were deleted during mon offline, these osds/pgs will be left over in pgmap until manully restart ceph-mon process Solution: reset pgmap before read pgmap full,make sure local maps are the same as the latest map Signed-off-by: z09440 Signed-off-by: song baisen --- src/mon/PGMonitor.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 6669ffcd4b35..c13a19755d9b 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -190,6 +190,8 @@ void PGMonitor::update_from_paxos(bool *need_bootstrap) int r = get_version(pg_map.version + 1, bl); if (r == -ENOENT) { dout(10) << __func__ << " failed to read_incremental, read_full" << dendl; + // reset pg map + pg_map = PGMap(); read_pgmap_full(); goto out; } -- 2.47.3