• Ozan Tezcan's avatar
    Handle response error cases gracefully (#137) · 8db9930c
    Ozan Tezcan authored
    A node can receive responses from followers who are not
    aware of they have been removed from the cluster configuration.
    In this case, recv_ family functions can be called without 
    a node structure. We should ignore these messages.
    
    We should also ignore snapshot and appendentries responses
    if we are not leader anymore. Returning an error code for 
    this case does not make sense because application cannot 
    do anything but ignore the error code. 
    
    This PR changes return value to zero for these cases. 
    8db9930c
raft_server.c 63.2 KB