Commit Graph

60 Commits (c7758c546a8706c2c6c2b12d63b5a220be88d9bc)

Author SHA1 Message Date
Edd Robinson f68637205c Check ShardGroup Duration when recreating database
Fixes #6153
2016-03-31 18:11:50 +01:00
Edd Robinson 828de361c6 Correct the CREATE RETENTION POLICY error behaviour
Partially addresses #6094.

Previously, when creating a retention policy only the name was
considered when deciding if the policy already existed. This meant that
adding a second policy with the same name but different duration or
replica factor returned the original policy and no error.

This commit fixes that and ensures that name, duration and replica
factor are all considered.
2016-03-29 11:07:26 +01:00
mvadu 8af9170c1d Add platform specific override for file rename.
In windows, it first deletes the target file (if it already exists).
2016-03-18 21:45:29 +05:30
Edd Robinson e5a41f7796 DROP SHARD 2016-03-14 22:59:55 +00:00
David Norton a2125bee24 check existing user with bcrypt 2016-03-14 18:40:25 -04:00
Cory LaNou 1d2c1faa94 address PR feedback 2016-03-14 16:55:54 +00:00
Cory LaNou 27cfaa4b7a in memory meta, single node configs, etc. 2016-03-14 16:55:54 +00:00
Cory LaNou c972c717b6 remove `client.NodeID` 2016-03-11 12:27:08 -07:00
Jason Wilder cd4ef1856b Use TCPHost when checking for existence of data node
Host is the http endpoint and is not really needed.
2016-03-01 21:23:03 -07:00
Ben Johnson 0dda9f6608 add remote execution
This commit adds remote execution to the query engine.
2016-02-25 08:41:20 -07:00
Jason Wilder 6f39b355bc Code cleanups 2016-02-22 15:06:05 -07:00
Jason Wilder a2d3d44505 Fix creating meta only nodes
This fixes a couple of issues with starting meta-only nodes.

1. We were always calling CreateDataNode regardless of whether the the
node is running data services.  We only call that now when node is
data enabled.
2. The node.json was created along-side creating the data node. Since
we are not creatinga a data node, this didn't happen anymore.  There
wasn't a simple way to do this in one place so it's actually handle
for when creating a meta or a data node now.  Since the ID assigned
to the node is the same regardless of role this works in all combinations
of roles.
3. The JoinMetaServer didn't return the ID of the joining node which
created some races when multiple nodes were joining.  The join call now
returns that information to the caller.

Fixes #5754
2016-02-22 15:06:05 -07:00
Edd Robinson 99a7341701 Wire up DROP retention policy to TSDB store.
Fixes #5653 and #5394.

Previously dropping retention policies did not propogate to local TSDB
shards. Instead, the retention policiess would just be removed from the
Meta Store.

This PR adds ensures that data associated with retention policies is
removed, when the retention policy is dropped.

Also, it cleans up a couple of other methods in `tsdb`, including the
requirement to provide (redundant) shardIDs when deleting databases.
2016-02-19 11:15:00 +00:00
Jason Wilder 886a62008e Fix dropping nodes
Dropping a meta node that had already been removed from the config
would fail because the raft.RemovePeers call would return an error
that the address was unknown.  This change skips calling RemovePeer
if it doesn't exist.

Dropping a non-existing ID would hang for 10 seconds becuase the
meta.Client retryUntilExec didn't differentiate before command errors
and redirect errors.  In this case, the command would return an error
but we'd try 10 more times and ultimately give up and return the error.
We now return immediately if the command returned and error because
retrying it will not succeed.

Finally, the join loop had no delay and would immediately try to join
the other nodes hundreds of times a second.  We now pause a second if we've
tried every node at least once.
2016-02-18 14:45:34 -07:00
Ben Johnson e3b4b71c13 refactor query executor
This commit moves the `QueryExecutor` to the `cluster` package
and provides an interface to it inside the `influxql` package.
2016-02-17 15:13:56 -07:00
Jonathan A. Sternberg 23da067593 Fix meta.Client CreateDatabaseWithRetentionPolicy RPC command
Previously, meta.Client would drop the default retention policy when
trying to create a database with a retention policy. The RPC has now
been modified to include the desired retention policy in the
CreateDatabase command and have it use that retention policy information
instead of the default configuration when provided.

This also lowers the number of RPC calls for
CreateDatabaseWithRetentionPolicy to only a single RPC call instead of
two.

Protections have also been included so creating a retention policy with
different parameters will return an error similar to if you tried to
modify the retention policy separately.

Fixes #5696.
2016-02-16 16:21:26 -05:00
Jason Wilder 6fb00c1a9b Remove MetaServers from node.json
This removes the MetaServers property from node.json to eliminate one
of the four places those addresses are stored on disk.  We always use
the values that come through the config (via file, env var or -join arg).
2016-02-15 22:42:51 -07:00
Cory LaNou f861d5811e fix adhoc joining of cluster 2016-02-12 11:35:19 -07:00
Cory LaNou d9f1df0ecf sane cluster starting with join args 2016-02-12 11:32:53 -07:00
Jason Wilder e1effa6601 fix build after rebase on master 2016-02-12 11:32:53 -07:00
Joe LeGasse 1852814612 Update authentication cache to work for clusters
Also removed unused code and duplicated test code
2016-02-12 07:16:57 -05:00
Ben Johnson 5a0d1ab7c1 rename influxdb/influxdb to influxdata/influxdb
This commit changes all the import and URL references from:

    github.com/influxdb/influxdb

to:

    github.com/influxdata/influxdb
2016-02-10 10:26:18 -07:00
Ben Johnson 627cd9d486 add dedupe iterator 2016-02-10 09:40:29 -07:00
Ben Johnson 607750ab1b add SHOW MEASUREMENTS iterator 2016-02-10 09:40:28 -07:00
Ben Johnson cde973f409 refactor query engine 2016-02-10 09:40:24 -07:00
David Norton efbac5fce2 fix #5505: clear authCache when pwd changes 2016-02-02 17:51:21 -05:00
Seif Lotfy 052f8d2a63 Return error if database is not found for setting the retention policy
Instead of returning nil, nil in case of no DB being found return
ErrDatabaseNotExists.
Fixes #5504
2016-02-02 21:02:40 +01:00
Jason Wilder ac0c593d8d Prevent double-read locking meta client
Possible fix for #5437.  meta.Client.RetentionPolicy acquired a read-lock and
then called Database which called data() which acquired a read-lock again.
If a write lock was taken between these two read-locks (likely by Authenticate),
the write-lock would block, and the second read-lock would also block
causing a dead-lock.
2016-01-24 22:01:09 -07:00
Jason Wilder 8456169855 Update backup/restore to use MetaClient 2016-01-21 15:32:35 -05:00
David Norton 2e8cfce7be convert CQ service to new meta client 2016-01-21 15:32:03 -05:00
Jason Wilder b7e1ecf471 Close idle MetaClient http connections
Prevents too many open files when running tests
2016-01-21 15:30:09 -05:00
David Norton 58c4474f53 retry AcquireLease on error 2016-01-21 15:28:34 -05:00
David Norton a2057415d8 meta lease retry 2016-01-21 15:28:34 -05:00
David Norton 38f09178ef add leases to meta service and client 2016-01-21 15:28:33 -05:00
Paul Dix 0341bc3532 Update meta client and retention service.
* Remove VisitRetentionPolicies from meta client.
* Update retention enforcer to run on every data node.
2016-01-21 15:28:33 -05:00
Paul Dix 70de1a7690 Update meta service/client and shard precreator.
* Wire up DataNode(id uint64).
* Remove IsLeader test on precreator.
* Clean up error in client if the server returns a non-200 on get snapshot.
2016-01-21 15:28:33 -05:00
Paul Dix 9ea8ff357e Wire up meta service and client delete data node 2016-01-21 15:28:33 -05:00
Paul Dix 7b71b66e31 Update meta service, meta client, and httpd handler
* Improve the ping endpoint so that it can optionally check for leader agreement across all meta servers
* Add Ping method to the meta client
* Fix ClusterID tests
* Remove WaitForLeader from meta client and remove unnecessary references to it
2016-01-21 15:28:33 -05:00
Paul Dix 2f07fe88ca Update meta client to use data method to protect cache 2016-01-21 15:28:33 -05:00
Paul Dix 101ab32571 Fix meta-service for server integration tests
* Updated CreateShardGroup to not return an error if it already exists so it's idempotent
* Removed old test making sure you can't delete the default RP. You can delete it now, there was no reason to disallow it.
* Wired up the UpdateRetentionPolicy functionality
2016-01-21 15:28:33 -05:00
Cory LaNou 2715d5ef72 add clusterID and tests 2016-01-21 15:28:33 -05:00
Paul Dix fb9181d240 Fix meta-service build 2016-01-21 15:28:33 -05:00
David Norton f23fea81b3 take rlock and grab ref to data 2016-01-21 15:28:33 -05:00
David Norton d1fcf1f7a1 wire up meta client shard methods 2016-01-21 15:28:33 -05:00
Paul Dix f385945058 Update Server to work with new metaservice/client 2016-01-21 15:28:33 -05:00
Cory LaNou a41222befb add continuous query/subscription methods to meta client 2016-01-21 15:28:33 -05:00
Paul Dix 9fd9a666bf Add CreateDataNode to meta client/service 2016-01-21 15:28:33 -05:00
Cory LaNou 53042ac56d bringing back client user methods 2016-01-21 15:28:33 -05:00
Paul Dix 0f36fbe5ce Add comment to client 2016-01-21 15:28:32 -05:00
Paul Dix 1632980eb8 Cleanup PrintLns in meta client 2016-01-21 15:28:32 -05:00