示例#1
0
void ReplicatedLog::OnAppendComplete()
{
    // TODO: this is not a complete solution
    if (paxosID < context->GetHighestPaxosID())
        context->GetDatabase()->Commit();

    if (!commitChaining)
    {
        acceptor.WriteState();
        context->GetDatabase()->Commit();
    }

    TryAppendNextValue();
}
示例#2
0
void ReplicatedLog::OnAppendComplete()
{
    waitingOnAppend = false;

    NewPaxosRound(); // increments paxosID, clears proposer, acceptor

    if (context->IsLeaseKnown() && paxosID <= context->GetHighestPaxosID())
        RequestChosen(context->GetLeaseOwner());

    if (paxosID < context->GetHighestPaxosID())
        context->GetDatabase()->Commit();

    if (!context->UseCommitChaining())
    {
        acceptor.WriteState();
        context->GetDatabase()->Commit();
    }

    context->OnMessageProcessed();

    TryAppendNextValue();
}