]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix synchronise pgmap with others 14418/head
authorsongbaisen <song.baisen@zte.com.cn>
Mon, 10 Apr 2017 02:21:06 +0000 (02:21 +0000)
committersongbaisen <song.baisen@zte.com.cn>
Mon, 10 Apr 2017 03:15:24 +0000 (03:15 +0000)
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 <zhao.mingyue@h3c.com>
Signed-off-by: song baisen <song.baisen@zte.com.cn>
src/mon/PGMonitor.cc

index 6669ffcd4b35838eaee8754fd30c38f73f2a65b3..c13a19755d9b64dd0d653c475edce8a25389e498 100644 (file)
@@ -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;
     }