New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not buffer rexi messages to disconnected nodes #838

Merged
merged 1 commit into from Sep 25, 2017

Conversation

Projects
None yet
2 participants
@nickva
Contributor

nickva commented Sep 25, 2017

Instead wait 15 seconds after last cluster configuration change, if there
were no more changes to the cluster, stop rexi buffers and servers for nodes
which are no longer connected.

Extract and reuse cluster stability check from couch_replicator_clustering
and move it to mem3_cluster module, so both replicator and rexi can use it.
Users of mem3_cluster would implement a behavior callback API then spawn_link
the cluster monitor with their specific period values.

This also simplifies the logic in rexi_server_mon as it no longer needs to
handle {nodeup, _} and {nodedown, _} messages. On any cluster membership
change it will get a cluster_unstable message. It then immediately spawns new
servers and buffers if needed. Only when cluster has stabilized it will stop
servers and buffers for disconnected nodes. The idea is to allow for short
periods of disconnects between nodes before throwing away all the buffered
messages.

@davisp

+1 after the one trivial change.

Show outdated Hide outdated src/mem3/src/mem3_cluster.erl
Do not buffer rexi messages to disconnected nodes
Instead wait 15 seconds after last cluster configuration change, if there
were no more changes to the cluster, stop rexi buffers and servers for nodes
which are no longer connected.

Extract and reuse cluster stability check from `couch_replicator_clustering`
and move it to `mem3_cluster` module, so both replicator and rexi can use it.
Users of `mem3_cluster` would implement a behavior callback API then spawn_link
the cluster monitor with their specific period values.

This also simplifies the logic in rexi_server_mon as it no longer needs to
handle `{nodeup, _}` and `{nodedown, _}` messages. On any cluster membership
change it will get a `cluster_unstable` message. It then immediately spawns new
servers and buffers if needed. Only when cluster has stabilized it will stop
servers and buffers for disconnected nodes. The idea is to allow for short
periods of disconnects between nodes before throwing away all the buffered
messages.

@nickva nickva merged commit 1eaf178 into apache:master Sep 25, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@nickva nickva deleted the cloudant:do_not_buffer_rexi_messages_for_disconnected_nodes_2 branch Sep 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment