Skip to content
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

[PUBDEV-3173] Client does not need to provide full flatfile anymore to connect to the flatfile-based cluster. #113

Merged
merged 1 commit into from
Aug 25, 2016

Conversation

mmalohlava
Copy link
Member

@mmalohlava mmalohlava commented Aug 19, 2016

Before this fix, the client was required to provide a flatfile with a list
of all nodes it would like to speak with (in fact all nodes in the cluster).

This fix changes the behaviour in the following way:

  • an H2O client needs only a subset of all nodes to list in the flatfile, but at least a single node
  • a regular H2O node which receives a heartbeat from a client node, adds it into a list of multicasted nodes and also
    sends a message to all visible nodes with information about client connection (which contains address of client).
    • when a regular node receives this event about client connection, it appends the received client information into
      the list of nodes for multicast. Hence, the node is going send hearbeats to the client as well (not only the first node which was
      contacted by the client initially).
  • on the client side, when the client receives a message from a node outside its flatfile, it just appends the node into the list
    of nodes for multicast

Missing parts:

  • the fix intentionally does not work in mixed environments (for example, backend based on multicast, client outside of multicast zone connecting via flatfile)
  • explicit client disconnect event implementation (different jira)

This change is Reviewable

@mmalohlava
Copy link
Member Author

Test in progress.

// Note: this could cause a temporary flood of messages since the other
// nodes will later inform about the connected client as well. It would be helpful
// to have a control over flatfile-based multicast to inject a small wait.
if (h2o._heartbeat._client) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary check here ?

@jakubhava
Copy link
Contributor

For me looks good. Already tested together with new sparkling water solution and works as expected.

@mmalohlava
Copy link
Member Author

Thanks @madman0708 - MichalK had also a few comments which i need to integrate. But will merge soon.

…o connect to the flatfile-based cluster.

Before this fix, the client was required to provide a flatfile with a list
of all nodes it would like to speak with (in fact all nodes in the cluster).

This fix changes the behaviour in the following way:
  - an H2O client needs only a subset of all nodes to list in the flatfile, but at least a single node
  - a regular H2O node which receives a heartbeat from a client node, adds it into a list of multicasted nodes and also
    sends a message to all visible nodes with information about client connection (which contains address of client).
    - when a regular node receives this event about client connection, it appends the received client information into
      the list of nodes for multicast. Hence, the node is going send hearbeats to the client as well (not only the first node which was
      contacted by the client initially).
  - on the client side, when the client receives a message from a node outside its flatfile, it just appends the node into the list
    of nodes for multicast

The fix also hides the field `H2O.STATIC_NODES` but provides API to access it.

Missing parts:
  - the fix intentionally does not work in mixed environments (for example, backend based on multicast, client outside of multicast zone connecting via flatfile)
  - explicit client disconnect event implementation (different jira)
@mmalohlava mmalohlava force-pushed the MM_PUBDEV-3173_client_mode_change branch from 1f5866a to 2ee836a Compare August 25, 2016 22:23
@mmalohlava mmalohlava merged commit d637901 into master Aug 25, 2016
@mmalohlava mmalohlava deleted the MM_PUBDEV-3173_client_mode_change branch August 25, 2016 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants