Commit Graph

18 Commits (93d93797da8052d21e43735a19e066f7e17bd4f9)

Author SHA1 Message Date
Cory LaNou c91c6c942c tweaks based on pr feedback 2015-11-11 10:04:26 -06:00
Cory LaNou 8a8564eb51 make raft self healing 2015-11-11 10:04:26 -06:00
Cory LaNou 70e1a832d2 Automatically promote node to raft if needed 2015-11-11 10:04:26 -06:00
Pablo Miranda b2195d03a8 completes lint for met folder 2015-11-06 22:54:23 -08:00
Cory LaNou b4637ab814 add more context to no leader errors 2015-10-23 14:48:32 -06:00
Jason Wilder 06d8ff7c13 Use config.Peers when passing -join flag
Removes the two separate variables in the meta.Config.  -join will
now override the Peers var.
2015-07-28 09:40:25 -06:00
Jason Wilder c93e46d569 Support add new raft nodes
This change adds the first 3 nodes to the cluster as raft peers. Other
nodes are data-only.
2015-07-28 09:40:25 -06:00
Jason Wilder 9dd66fa4ad Make meta RPC private 2015-07-23 10:21:25 -06:00
Jason Wilder 29011c5cf2 Code review fixes 2015-07-23 10:21:25 -06:00
Jason Wilder b78ac4bf15 Add RPC tests 2015-07-23 10:21:24 -06:00
Jason Wilder 84a8d7d24b Add cluster-tracing option to meta config
Useful for troubleshooting but too verbose for regular use.
2015-07-23 10:21:24 -06:00
Jason Wilder a7fa5eb634 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.
2015-07-23 10:21:23 -06:00
Jason Wilder ad8948b4a6 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.
2015-07-23 10:21:23 -06:00
Jason Wilder cb718b9832 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.
2015-07-23 10:21:23 -06:00
Jason Wilder 9db3a779e9 Assign and store a node ID when joining an existing cluster 2015-07-23 10:21:23 -06:00
Jason Wilder 3f90891b82 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.
2015-07-23 10:21:23 -06:00
Jason Wilder e06f6f421b 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.
2015-07-23 10:21:22 -06:00
Jason Wilder abfd438a11 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.
2015-07-23 10:21:22 -06:00