Skip to content
Snippets Groups Projects
Commit 226f79bd authored by Vladislav Shpilevoy's avatar Vladislav Shpilevoy
Browse files

swim: make swim_upsert_member returning two values

swim_upsert_member is a function to add new members or update
existing ones using info received from other cluster
participants. At this moment it is quite simple and
straightforward: either create a new member and return it, or
update an existing member and return it.

But things are going to change in failure detection and
dissemination components. A couple of examples showing that a
member should be returned separately from success/error status:

  * To prevent undead members the failure detection forbids to
    add dead members. Otherwise a dead member would be added and
    removed back and forth by different components infinitely.
    Upsert for such members should return NULL, but it is not an
    error - it is a normal function of the protocol;

  * When the dissemination component receives a UUID update of
    an existing member, but with too old incarnation, it does not
    apply that update. On the other hand it can not return that
    old member from upsert because of UUID being different from
    the one in the 'request'. In such a case it should be ok to
    return NULL, but do not deem it an error.

Part of #3234
parent 9eb66ae7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment