Skip to content

Commit

Permalink
fix bug: avoid propose with null membership.
Browse files Browse the repository at this point in the history
  • Loading branch information
lynncui00 committed Sep 9, 2016
1 parent f6f67b6 commit 3c807e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/config/system_v_sm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const bool SystemVSM :: IsValidNodeID(const nodeid_t iNodeID)

const bool SystemVSM :: IsIMInMembership()
{
return IsValidNodeID(m_iMyNodeID);
return m_setNodeID.find(m_iMyNodeID) != end(m_setNodeID);
}

///////////////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 5 additions & 0 deletions src/test/test_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ int TestServer :: Ready()
{
printf("ready paxos ok, ip %s port %d\n", m_oMyNode.GetIP().c_str(), m_oMyNode.GetPort());
}
else
{
printf("ready paxos fail, ip %s port %d ret %d\n",
m_oMyNode.GetIP().c_str(), m_oMyNode.GetPort(), ret);
}

return ret;
}
Expand Down

0 comments on commit 3c807e9

Please sign in to comment.