Commit Graph

35 Commits (30364aa2b068d23c962d8b51583b01a171ede1ff)

Author SHA1 Message Date
Jason Wilder 59ddaa960b Fix meta.WaitForDataChanged not signaling for remote nodes
WaitForDataChanged is used to block a goroutine so it can be woken
up when the metastore has been updated.  This makes it so clients
to the metastore do not need to poll the metastore repeatedly to
watch for changes.  This was only working for local raft nodes, but
was supposed to work for remote nodes as well.
2015-10-13 10:20:38 -06:00
Philip O'Toole d74e0690c7 Revert "Merge pull request #4233 from influxdb/drop-server"
This reverts commit 0bdb36f6dc, reversing
changes made to 3085fbc138.
2015-10-02 08:39:57 -07:00
Cory LaNou 42896fee0f use close instead of shutdown 2015-10-02 09:10:01 -05:00
Cory LaNou def2551d65 to much code depends on setting this to nil yet 2015-10-01 15:57:55 -05:00
Cory LaNou 98de77eeaf attempt to heal a cluster, shut down raft after removing a node 2015-10-01 15:39:16 -05:00
Cory LaNou c108c6eb96 fix remove peer, add leader to show servers 2015-10-01 15:39:16 -05:00
Cory LaNou 3071eec2ca only the leader can remove a peer 2015-10-01 15:39:16 -05:00
Cory LaNou df08a070f6 do not remove raft files unless it is the node being removed 2015-10-01 15:39:16 -05:00
Cory LaNou 96d63cf9f0 simpler remove peer 2015-10-01 15:39:16 -05:00
Cory LaNou 7a3e1f6b27 removing peer wip 2015-10-01 15:39:15 -05:00
Jason Wilder 0286a3e7fe Fix deadlock in metastore
The interaction of continuous query service, the meta-store loading
and initializing raft state, and syncing node info could cause a
deadlock in some instances.  There was an extra read-lock taken by isLeader()
when it already had a read-lock.  Removing this extra lock fixes the startup
deadlock.

Fixes #3607
2015-08-26 14:43:17 -06:00
Jason Wilder 9b16353893 Shutdown raft transport and layer first
The raft.Shutdown() call was deadlocking if operations were still
being applied to the log sometimes.  Change the shutdown behavior to
match how consul shuts down raft:

e37b5ecb69/consul/server.go (L471-L477)
2015-08-13 15:31:31 -06:00
Jason Wilder 5796aec703 Fix race when closing local raft state 2015-08-13 10:02:05 -06:00
Jason Wilder 29c6094a54 Log raft leader state changes
Make is much easier to determine when a cluster is in a healthly state
as well as who the current leader is.
2015-08-13 10:01:42 -06:00
Jason Wilder 5280b20e66 Make host rename on single node more seemless
Renaming a host that is a raft peer member is pretty difficult but
we can special case single-node renames since we know all the member
in the cluster and we can update the peer store directly on all nodes
(just one).

Fixes #3632
2015-08-13 10:01:42 -06:00
Jason Wilder 3b0b227d31 Wait for raft to close before meta store close returns
Fixes #3516
2015-08-05 15:41:39 -06:00
Jason Wilder 13052e60f2 Sync hostname to metastore after startup
If the -hostname flag is passed, the node will startup and be accessible from
remote nodes using the specified hostname.  At startup, we attempt to update
the hostname if it's different.  For data-only nodes, this is pretty straight-forward.
For nodes part of the raft cluster, it is much more complicated as the the cluster
must be up and stable (with a leader) for a the update to take place.  The main
complication in this case is that the node starting up will have a different
hostname and will fail to take part of the raft cluster because each other node
does not have this new name in the it's raft peers list.  Since this is very problematic
and very easy to break a cluster, this PR just aborts startup and alerts the operator that
some manual actions must be taken to update the raft peer on all raft members before
the hostname can be fully updated.

Fixes #3421
2015-08-05 14:17:26 -06:00
Jason Wilder 2b76dac479 Don't resolve hostname when creating node
Hostnames were always being resolved to an IP address and the IP
address was used as the host address and raft peer address.  There
was no way to use an actual hostname instead of an IP address.
2015-08-05 14:17:26 -06:00
Jason Wilder 90c85cb933 Fix restart single node
Restarting a single node would not bootstrap its raft state
2015-07-28 13:17:59 -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 f5705aebe1 Rename raftState.openRaft to open 2015-07-28 09:40:25 -06:00
Jason Wilder e9044166d6 Invalidate raft member by fetching from leader 2015-07-23 10:21:25 -06:00
Jason Wilder 29011c5cf2 Code review fixes 2015-07-23 10:21:25 -06:00
Jason Wilder 85db9c46e8 Move remaining raft impl details to local raft state 2015-07-23 10:21:24 -06:00
Jason Wilder 790733daad Move snapshot to raft state 2015-07-23 10:21:24 -06:00
Jason Wilder 54e116507f Move apply to raft state 2015-07-23 10:21:24 -06:00
Jason Wilder a9314d6bb7 Move raft index to raft state 2015-07-23 10:21:24 -06:00
Jason Wilder 17a9bb041b Remove raftEnabled func
Not needed since it was just used as a safeguard for seeing if we
are the leader.
2015-07-23 10:21:24 -06:00
Jason Wilder 72e2e1a6f2 Move addPeer to raft state 2015-07-23 10:21:24 -06:00
Jason Wilder 80248f9b53 Remote leaderCh
Not used
2015-07-23 10:21:24 -06:00
Jason Wilder b86fecfd80 Move setPeers to raft state 2015-07-23 10:21:24 -06:00
Jason Wilder 9e4339753f Move leaderCh() to raft state 2015-07-23 10:21:23 -06:00
Jason Wilder 33730da32b Move isLeader to raft state 2015-07-23 10:21:23 -06:00
Jason Wilder fb8a4db74f Move raft closing to localRaft state 2015-07-23 10:21:23 -06:00
Jason Wilder 5ea8342892 Move raft state to separate file
store.go is getting big.
2015-07-23 10:21:23 -06:00