Commit Graph

6674 Commits (b78ac4bf15e2ae36ffa1416e8b48615834b83713)

Author SHA1 Message Date
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 c1fc83e3d5 Make join private so it does not show up in config command 2015-07-23 10:21:24 -06:00
Jason Wilder 29b11a20a2 Support multiple comma-separated join addresses
Will try each once until one succeeds
2015-07-23 10:21:24 -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
Jason Wilder f3fcfebf83 Make raftState interface private 2015-07-23 10:21:23 -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 5486d3e216 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.
2015-07-23 10:21:23 -06:00
Jason Wilder 43f0407178 Ensure a node can join an existing single node raft cluster 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
Jason Wilder 49f52bac50 Merge pull request #3448 from influxdb/jw-disable-race-test
Disable race tests until hashicorp raft lib is updated
2015-07-23 10:15:33 -06:00
Jason Wilder 353663baf2 Disable race tests until hashicorp raft lib is updated 2015-07-23 10:12:16 -06:00
dgnorton 2c9497f2e2 Merge pull request #3404 from jhorwit2/jah/parser-fix
Fixes #3403 - Added check for escaped single quote in string
2015-07-22 19:32:24 -04:00
Josh Horwitz 96938e8a2b Added check for escaped single quote in string 2015-07-22 17:47:48 -04:00
Philip O'Toole 9949de3f44 Fix typo in comment 2015-07-22 13:59:43 -07:00
Jason Wilder a27480780e Update changelog 2015-07-22 14:50:52 -06:00
Jason Wilder c8e17cb4b2 Fix querying fields with spaces and quotes 2015-07-22 14:50:14 -06:00
Jason Wilder 37c971bb82 Fix querying measurements with spaces
Fixes #3319
2015-07-22 14:49:54 -06:00
Ben Johnson 8057742abd Merge pull request #3431 from benbjohnson/engine
Engine Refactor
2015-07-22 12:23:31 -06:00
Ben Johnson 2a9f1d0704 remove Engine.DB 2015-07-22 11:08:10 -06:00
Ben Johnson cc0607a5cf remove Engine.Flush() 2015-07-22 11:08:10 -06:00
Ben Johnson a7f50ae03c refactor storage to engine 2015-07-22 11:08:10 -06:00
Philip O'Toole 3482c50ae3 Update CHANGELOG for PR 3334
[ci skip]
2015-07-22 10:07:14 -07:00
Ben Johnson 4dc15a833e rename engine.go to executor.go 2015-07-22 11:07:06 -06:00
Ben Johnson de1f9a3736 refactor tsdb tests into test package 2015-07-22 11:07:06 -06:00
Philip O'Toole d9ba1cc38d Merge pull request #3420 from nathanielc/master
catch opentsdb malformed tags if they are missing keys or values
2015-07-22 10:06:09 -07:00
Philip O'Toole 8484d93273 Merge pull request #3428 from influxdb/optimize_key
Optimize Query Engine
2015-07-22 08:49:26 -07:00
Philip O'Toole 42b4a0b8bf string return is totally unused 2015-07-22 02:55:13 -07:00
Philip O'Toole 45dcf9960c Optimize the very inner loop of cursor iteration
This change moves tracking of next timestamp and values to simple
slices, as performance measurement showed that Peek() on TagSet cursors
was a huge performance drain. There is much more that can be done here,
but with this in place query performance has been restored to 0.9.1
levels.

This change also uses -1 to indicate that no value is available for a
given timestamp.
2015-07-22 02:55:09 -07:00
Nathaniel Cook 17cc09259b change for better code clarity 2015-07-21 19:40:43 -06:00
Nathaniel Cook 3e29d8821a catch opentsdb malformed tags if they are missing keys or values 2015-07-21 16:11:58 -06:00
Jason Wilder 8c715f72ab Merge pull request #3415 from influxdb/jw-3411
Fix parse stuck in loop causing 500 timeout
2015-07-21 14:14:36 -06:00
Gunnar dcc37354a9 Merge pull request #3409 from influxdb/ga-fix-3380
Parser fix, only allow ORDER BY ASC and ORDER BY time ASC
2015-07-21 12:17:40 -07:00
gunnaraasen eca76ed7a3 Parser fix, only allow ORDER BY clause with time ASC 2015-07-21 12:07:56 -07:00