Closed xit4 closed 9 years ago
i temporarily avoided the issue by making handleInit()
always return false
.
no idea why it should return true
in the first place.
Because I thought that if an init was received we had to check handleInit() the next time at first for an "end_handshake" message. But I think that init-init_ack-end_handshake are useless messages if a node (everytime that calls finishConnect from a connectable key) starts a non-blocking read operation. These messages are useless imho
so, should everything be moved to finishconnect()
?
how are nodes going to fill replicas without knowing the exact view of the connected node?
start a read()
every time?
I do agree that the init messages are removable but they also handle replica initialization and leader communication for newly connected nodes.
on this last point: if 1-6 connect and elect 6 everything is fine; when 7 connects the sees there is quorum and starts election electing itself as leader cause his ID is bigger. somebody has to tell him that the cluster already has a leader.
continuing on this point: i think the leader election we implemented should handle this case without us doing anything. If a new node with higher ID joins the cluster, he should start the election and elect the leader already present in the system. for our example: 6 is leader for nodes 1-6; 7 connects and has 6 and 7 as seemCrd; 7 does not have support of quorum so is discarded, 6 is the leader.
yup ok, we can leave init and init_ack but we have to figure out the right place and what they should contain (leader_id as well?). maybe when a server accepts a connection he sends a message to the init client (with unknown id) in this way the connecting client(server) can do the synchronization? So maybe move init from finishConnect() to accept() method
As seen at lines https://github.com/lightem90/testMRMW/blob/2cbf5ba6410e180a18aba6d2ab93691289f0dcdf/src/NetworkPrimitives/ConnectionManager.java#L186
handleInit()
is called with a message m and a boolean initIsOver which istrue
at first and is modified inhandleInit()
itself for later usages.I don't understand the meaning of this. Why do we need initIsOver?