bbengfort / cloudscope

Simulation and visualization of distributed systems and communications.
http://bbengfort.github.io/cloudscope/
MIT License
1 stars 0 forks source link

Correctness of duplicate/ out of order AE #91

Open bbengfort opened 7 years ago

bbengfort commented 7 years ago

On line 563 we have the following code:

        if self.log.lastApplied >= rpcInsertIndex:
            # Possibly a duplicate append entries (or out of order AE)
            # If we're at this point we should have a non-conflicting entry
            # at the insert index. So just return and do nothing with this.
            self.sim.logger.warn((
                "{} received possible out of order append entries "
                "- there exists a non conflicting entry at index {}".format(
                    self, rpcInsertIndex
                )
            ))
            return

This occurs after step 3 in the Raft AE RPC response guide, meaning that no truncation has occurred.

My diagnosis is that when this condition is true there is an entry at the insert index that does not conflict with the append entries, however the log is ahead of where the AE should be.

My solution right now is to simply drop that message, but I feel like we should check the correctness of that scenario.