Oh... I think I find the answer. New primay can't become Active without communcating with the old primay or at least one old replica. Instead, the new primay will enter InComplete state which does not provide service. so the old primary can provide services safely because it can still reach all its replicas. On the other hand if the network splits between the primary and its replicas, new primary could become Active. But the old primary couldn't provide service anymore for it has lost its replicas, so the new primary can become Active safely. That is, for the following two scene: 1, the primay is partitioned from its replicas 2, the primay and all its replicas are partitioned from the mons There will alway be only one Active primay for the same PG. Am I right? On 6 April 2013 19:54, Yan, Zheng <ukernel@xxxxxxxxx> wrote: > On Sat, Apr 6, 2013 at 1:22 PM, 袁冬 <yuandong1222@xxxxxxxxx> wrote: >> >> Hi guys. >> >> I have a problem when reading the codes of the ceph. >> >> In the osd.cc, the tick method will check if the mon is timeout by >> compare "now - g_conf->osd_mon_ack_timeout" with last_pg_stats_ack, if >> it's timeout, then monc->reopen_session() will be called to try to >> re-connect to the mon. >> >> The question is that, if the network has splited so that the osd will >> never be able to connect to any mon, how do the PGs on the osd know >> that? I think the PGs may still believe they are heathly with the >> current OSDMap even the mons have already mark their osd down & out >> (but couldn't tell them for the network problem), Then they continue >> to sevice clients who have the same OSDMap with them. So two primary >> PG may exist in the cluster at the same time which is terrible. > > > When OSDs communicate, they check if their OSDMaps match. If not, ODS that > has > newer OSDMap sends OSDMap to ODSs that have old map. To migrate a PG to new > OSDs, the new OSDs need communicate with the old OSDs, so it's impossible to > have > two active PG primaries exist at the same time. > > >> >> >> I want to knwon any code work with this issue or is there some wrong >> with my opinion? >> >> Thanks for any help! >> >> >> -- >> 袁冬 >> Email:yuandong1222@xxxxxxxxx >> QQ:10200230 >> -- >> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in >> the body of a message to majordomo@xxxxxxxxxxxxxxx >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > -- 袁冬 Email:yuandong1222@xxxxxxxxx QQ:10200230 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html