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

Support joining nodes to an existing cluster #3372

Merged
merged 32 commits into from
Jul 23, 2015
Merged

Support joining nodes to an existing cluster #3372

merged 32 commits into from
Jul 23, 2015

Commits on Jul 23, 2015

  1. Implement remote meta data fetch

    This adds some basic plumbing to make remote procedure calls to other cluster
    members.  This first implementation allows a node to contact the raft leader
    and fetch a copy of the meta data. This will be used by non-raft members to
    pull down the latest metadata.
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    abfd438 View commit details
    Browse the repository at this point in the history
  2. Add ability to join an existing cluster

    This adds some basic ability to join a node to an existing cluster. It
    uses a rpc layer to initiate a join request to an existing memeber. The
    response indicates whether the joining node should take part in the raft
    cluster and who it's peers should be.  If raft should not be started, the
    peers are the addresses of the current raft members that it should delegate
    consensus operations.
    
    To keep the meta store implementation agnostic of whether it's running
    a local raft or not, a consensusStrategy type was also added.
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    e06f6f4 View commit details
    Browse the repository at this point in the history
  3. Proxy raft and rpc connections to leader transparently

    Nodes that are not part of the raft cluster will not reliably know who the
    current raft cluster leader is.  To make communication simpler, proxy all
    rpc and raft calls to the current raft leader if a non-leader receives one.
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    3f90891 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9db3a77 View commit details
    Browse the repository at this point in the history
  5. Only allow adding non-raft nodes for now

    Adding raft nodes is more complicated and can break a cluster when
    moving from 1 to 2 nodes.  This will be fixed in later PR.
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    cb718b9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    43f0407 View commit details
    Browse the repository at this point in the history
  7. Move invalidate to raft state

    The behavior is different depending on the state.  Local raft just
    waits a second (?) and remote raft fetches the meta data from the leader.
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    5486d3e View commit details
    Browse the repository at this point in the history
  8. Fix up rpc error handling

    Some errors would not be returned to the client because something
    failed before we could create the appropriate respone.  For these
    cases, a general error response is returned.
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    ad8948b View commit details
    Browse the repository at this point in the history
  9. Propogate metadata changes from raft nodes to non-raft nodes

    Non-raft nodes need to be notifified when the metastore changes. For
    example, a database could be dropped on node 1 (non-raft) and node 2
    would not know.  Since queries for that database would not be a cache
    miss, node 2 would not get updated.
    
    To propogate changes to non-raft nodes, each non-raft node maintains
    a blocking connection to a raft node that blocks until a metadata
    change occurs.  When the change is triggered, the updated metadata
    is returned to the client and the client idempotently updates its local
    cache.  It then reconnects and waits for another change.  This is
    similar watches in zookeeper or etcd.  Since the blocking request is
    always recreated, it also serves as a polling mechanism that will retry
    another raft member if the current connection is lost.
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    a7fa5eb View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f3fcfeb View commit details
    Browse the repository at this point in the history
  11. Move raft state to separate file

    store.go is getting big.
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    5ea8342 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    fb8a4db View commit details
    Browse the repository at this point in the history
  13. Move isLeader to raft state

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    33730da View commit details
    Browse the repository at this point in the history
  14. Move leaderCh() to raft state

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    9e43397 View commit details
    Browse the repository at this point in the history
  15. Move setPeers to raft state

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    b86fecf View commit details
    Browse the repository at this point in the history
  16. Remote leaderCh

    Not used
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    80248f9 View commit details
    Browse the repository at this point in the history
  17. Move addPeer to raft state

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    72e2e1a View commit details
    Browse the repository at this point in the history
  18. Remove raftEnabled func

    Not needed since it was just used as a safeguard for seeing if we
    are the leader.
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    17a9bb0 View commit details
    Browse the repository at this point in the history
  19. Move raft index to raft state

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    a9314d6 View commit details
    Browse the repository at this point in the history
  20. Move apply to raft state

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    54e1165 View commit details
    Browse the repository at this point in the history
  21. Move snapshot to raft state

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    790733d View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    85db9c4 View commit details
    Browse the repository at this point in the history
  23. Support multiple comma-separated join addresses

    Will try each once until one succeeds
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    29b11a2 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    c1fc83e View commit details
    Browse the repository at this point in the history
  25. Add cluster-tracing option to meta config

    Useful for troubleshooting but too verbose for regular use.
    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    84a8d7d View commit details
    Browse the repository at this point in the history
  26. Add RPC tests

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    b78ac4b View commit details
    Browse the repository at this point in the history
  27. Code review fixes

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    29011c5 View commit details
    Browse the repository at this point in the history
  28. Fix race in test code

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    eb7d181 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    47b8de7 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    e904416 View commit details
    Browse the repository at this point in the history
  31. Make meta RPC private

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    9dd66fa View commit details
    Browse the repository at this point in the history
  32. Update changelog

    jwilder committed Jul 23, 2015
    Configuration menu
    Copy the full SHA
    3c308e3 View commit details
    Browse the repository at this point in the history