Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why AskforCheckpoint don't use lock? #170

Open
fishfreetaken opened this issue Aug 21, 2019 · 1 comment
Open

why AskforCheckpoint don't use lock? #170

fishfreetaken opened this issue Aug 21, 2019 · 1 comment

Comments

@fishfreetaken
Copy link

if I have 5 nodes, the node 5th need to get the checkpoint. When the 5th receive three node checkpoint's ack (for example :1,2,3), 3th node is ready to transmit its checkpoint and jump into begin, but now 5th node receive 4th checkpoint's ack and 4th also goes into begin states to transmit its checkpoint. In such case, 4th node will override 3th node checkpoint. My question is how to avoid it? I can't find the result in source code. Please release me!!!!! Thank you!

@drusong
Copy link

drusong commented Dec 18, 2019

have you figured it out ?
I think i might got an answer after reading the source code of learner and checkpoint_sender.
Before asking for checkpoint from a learnee, a learner must first enter askforcheckpoint mode,which is judged by past the majoritycount of paxosgroup. code int cp_mgr:PrepareForAskforCheckpoint
`if (llNowTime > m_llLastAskforCheckpointTime + 60000)
{
PLGImp("no majority reply, just ask for checkpoint");
}
else
{

    if ((int)m_setNeedAsk.size() < m_poConfig->GetMajorityCount())
    {
        PLGImp("Need more other tell us need to AskForCheckpoint");
        return -2;
    }
}

m_llLastAskforCheckpointTime = 0;
m_bInAskforCheckpointMode = true;`

And only if one learner enters into this "m_bInAskforCheckpointMode",then it will send a askforcheckpoint request to a single node,which will successfully build a checkpoint transport between learner and learnee,through the mechanism of send and ack of checkpoint sequence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants