-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Commits on Jul 23, 2015
-
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.
Configuration menu - View commit details
-
Copy full SHA for abfd438 - Browse repository at this point
Copy the full SHA abfd438View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for e06f6f4 - Browse repository at this point
Copy the full SHA e06f6f4View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 3f90891 - Browse repository at this point
Copy the full SHA 3f90891View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9db3a77 - Browse repository at this point
Copy the full SHA 9db3a77View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for cb718b9 - Browse repository at this point
Copy the full SHA cb718b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 43f0407 - Browse repository at this point
Copy the full SHA 43f0407View commit details -
The behavior is different depending on the state. Local raft just waits a second (?) and remote raft fetches the meta data from the leader.
Configuration menu - View commit details
-
Copy full SHA for 5486d3e - Browse repository at this point
Copy the full SHA 5486d3eView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for ad8948b - Browse repository at this point
Copy the full SHA ad8948bView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for a7fa5eb - Browse repository at this point
Copy the full SHA a7fa5ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for f3fcfeb - Browse repository at this point
Copy the full SHA f3fcfebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ea8342 - Browse repository at this point
Copy the full SHA 5ea8342View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb8a4db - Browse repository at this point
Copy the full SHA fb8a4dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 33730da - Browse repository at this point
Copy the full SHA 33730daView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e43397 - Browse repository at this point
Copy the full SHA 9e43397View commit details -
Configuration menu - View commit details
-
Copy full SHA for b86fecf - Browse repository at this point
Copy the full SHA b86fecfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 80248f9 - Browse repository at this point
Copy the full SHA 80248f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 72e2e1a - Browse repository at this point
Copy the full SHA 72e2e1aView commit details -
Not needed since it was just used as a safeguard for seeing if we are the leader.
Configuration menu - View commit details
-
Copy full SHA for 17a9bb0 - Browse repository at this point
Copy the full SHA 17a9bb0View commit details -
Configuration menu - View commit details
-
Copy full SHA for a9314d6 - Browse repository at this point
Copy the full SHA a9314d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 54e1165 - Browse repository at this point
Copy the full SHA 54e1165View commit details -
Configuration menu - View commit details
-
Copy full SHA for 790733d - Browse repository at this point
Copy the full SHA 790733dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 85db9c4 - Browse repository at this point
Copy the full SHA 85db9c4View commit details -
Support multiple comma-separated join addresses
Will try each once until one succeeds
Configuration menu - View commit details
-
Copy full SHA for 29b11a2 - Browse repository at this point
Copy the full SHA 29b11a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for c1fc83e - Browse repository at this point
Copy the full SHA c1fc83eView commit details -
Add cluster-tracing option to meta config
Useful for troubleshooting but too verbose for regular use.
Configuration menu - View commit details
-
Copy full SHA for 84a8d7d - Browse repository at this point
Copy the full SHA 84a8d7dView commit details -
Configuration menu - View commit details
-
Copy full SHA for b78ac4b - Browse repository at this point
Copy the full SHA b78ac4bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 29011c5 - Browse repository at this point
Copy the full SHA 29011c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb7d181 - Browse repository at this point
Copy the full SHA eb7d181View commit details -
Configuration menu - View commit details
-
Copy full SHA for 47b8de7 - Browse repository at this point
Copy the full SHA 47b8de7View commit details -
Configuration menu - View commit details
-
Copy full SHA for e904416 - Browse repository at this point
Copy the full SHA e904416View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9dd66fa - Browse repository at this point
Copy the full SHA 9dd66faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c308e3 - Browse repository at this point
Copy the full SHA 3c308e3View commit details