Commit Graph

155 Commits (9491846047859774273faae66f60640dd531fe30)

Author SHA1 Message Date
Cory LaNou 1228de4e7c move tcp to cluster 2015-05-27 10:02:38 -06:00
Jason Wilder 85f59d696b Create and open shards on-demand
Uses a structure like:

  /root/
      /db1/rp1/1
              /2
      /db2/rp2/3

If a write is assigned to a shard on the local node but the shard
has not been created, create it when the write returns an error
and retry the write.
2015-05-26 16:38:45 -06:00
Jason Wilder cb23a7a297 Fix breakage from rename of data to cluster package 2015-05-26 15:42:44 -06:00
Paul Dix 01618dc143 Move data.Node to tsdb.Store. Move data to cluster. 2015-05-26 15:56:54 -04:00
Ben Johnson f52c85a8a1 Query engine and parser integration into root pkg. 2014-11-09 19:55:53 -07:00
Ben Johnson b78d4f1329 Add basic query code into the database. 2014-11-06 20:18:36 -05:00
Ben Johnson 9d1464813a Merge branch 'master' of https://github.com/influxdb/influxdb into streaming-raft
Conflicts:
	Makefile.in
	_vendor/raft/server.go
	_vendor/raft/snapshot.go
	_vendor/raft/snapshot_test.go
	admin/http_server.go
	admin/http_server_test.go
	api/graphite/api.go
	api/http/series_writer.go
	cluster/cluster_configuration.go
	cluster/cluster_server.go
	cluster/nil_processor.go
	cluster/shard_space.go
	cmd/influxd/main.go
	common/helpers.go
	configuration/configuration.go
	configuration/configuration_test.go
	coordinator/protobuf_server.go
	coordinator/raft_server.go
	datastore/point_iterator.go
	datastore/shard.go
	datastore/storage_key.go
	engine/aggregator_engine.go
	engine/arithmetic_operators.go
	parser/group_by.go
	parser/query_api.go
	response_channel.go
	server/server.go
2014-11-06 01:20:36 -05:00
John Shahid 1f5f5cb789 Don't write points if they are too old
Background of the bug: Prior to this patch we actually tried writing
points that were older than the retention period of the shard. This
caused race condition when it came to writing points to a shard that's
being dropped, which will happen frequently if the user is loading old
data (by accident). This is demonstrated in the test in this commit.This
bug was previously addressed in #985. It turns the fix for #985 wasn't
enough. A user reported in #1078 that some shards are left behind and
not deleted.

It turns out that while the shard is being dropped more write
requests could come in and end up on line `cluster/shard.go:195` which
will cause the datastore to create a shard on disk that isn't tracked
anywhere in the metadata. This shard will live forever and never get
deleted. This fix address this issue by not writing old points in, but
there are still some edge cases with the current implementation, at
least not as bad as current master.

Close #1078
2014-11-03 17:28:47 -05:00
Ben Johnson 31f981e804 Refactoring common, cluster, and protobuf. 2014-10-31 19:31:19 -06:00
John Shahid 60c98e519e Remove some nonsense 2014-10-30 14:16:46 -04:00
David Norton 9786d31db3 Add func to get str desc of Processor chain
Close #1068
2014-10-29 16:39:04 -04:00
John Shahid c265f1f588 Delete shards only after making sure no has a reference to it.
* shard_datastore.go(Deleteshard): Check the reference count of the
  shard and mark it for deletion if there are still more references out
  there. Otherwise, delete the shard immediately. Also refactor the
  deletion code in deleteShard(), see below.
* shard_datastore.go(ReturnShard): Check to see if the shard is marked
  for deletion.
* shard_datastore.go(deleteShard): Refactor the code that used to be in
  Deleteshard in its own method. Use `closeShard` instead of doing the
  cleanup ourselves.
2014-10-24 16:36:45 -04:00
John Shahid b1646cb68d Make the error message clear when a series is missing
Fix #778
2014-10-23 12:23:42 -04:00
Ben Johnson 7db0e15799 Refactoring into root. 2014-10-21 23:32:19 -06:00
John Shahid 78b99f60c6 Merge points at the shard level 2014-10-21 17:57:13 -04:00
John Shahid 465614c173 Modify merge to work with regex 2014-10-21 17:57:13 -04:00
Ben Johnson f6ef96c142 Refactor broker to messaging pkg. 2014-10-20 20:42:03 -06:00
John Shahid 8692780bf4 Some refactoring 2014-10-20 15:24:39 -04:00
Todd Persen 9f89aaeb26 Aggregating by time should respect the natural boundaries of the argument.
Fix #387
2014-10-20 15:24:39 -04:00
Ben Johnson 14fd40cdb5 Add streaming HTTP broker handler. 2014-10-16 22:11:28 -06:00
John Shahid 4c655ddc3d fixup! Querying for data outside of existing shards should return an empty response. 2014-10-15 12:27:15 -04:00
John Shahid da4f56fbbb Don't use the same server id more than once
Fix #972
2014-10-07 18:32:14 -04:00
John Shahid 0ca44c906d Merge branch '0.8'
Conflicts:
	api/http/api.go
	cluster/cluster_configuration.go
	cluster/cluster_configuration_test.go
	coordinator/coordinator.go
	engine/aggregator_operators.go
	engine/common_merge_engine.go
	integration/data_test.go
	parser/parser.go
2014-09-24 18:55:19 -04:00
John Shahid fbf9a47405 Fix a test that was broken by @pauldix 2014-09-24 18:06:03 -04:00
John Shahid 1ff8ba4ccd Don't automatically create shards
This was causing InfluxDB to create a new shard in the grafana db every
ten minutes. Also we talked about getting rid of this feature a while
ago, so here we go.

Fix #954

Conflicts:
	cluster/cluster_configuration.go
2014-09-24 18:06:03 -04:00
Paul Dix 7f8c4778f6 Move cluster config from raft to API.
Fixes #853. Close #854. Previously, there was an unprotected endpoint in
raft to return the cluster config that would include user hashes. This
endpoint is useful for debugging purposes so I restructured it and moved
it to the API. It ensures the requesting user is a cluster admin.

Cluster config will now return all of the cluster state including
servers, CQs, shards, etc.

Conflicts:
	integration/single_server_test.go
2014-09-24 17:40:29 -04:00
John Shahid eef53f7228 Don't automatically create shards
This was causing InfluxDB to create a new shard in the grafana db every
ten minutes. Also we talked about getting rid of this feature a while
ago, so here we go.

Fix #954
2014-09-22 14:49:59 -04:00
Paul Dix f0c0abdb10 Add option to include space to series mappings in list series query.
Fixes #867. Close #927. Updated lexer and parser to work, added code to
coordinator to insert spaces if requested. Now the user can request the
shard spaces. `list series include spaces`
2014-09-11 11:28:18 -04:00
John Shahid f2e57008e2 add a missing import 2014-09-08 15:09:05 -04:00
Paul Dix 39091fc8fd Move cluster config from raft to API.
Fixes #853. Close #854. Previously, there was an unprotected endpoint in
raft to return the cluster config that would include user hashes. This
endpoint is useful for debugging purposes so I restructured it and moved
it to the API. It ensures the requesting user is a cluster admin.

Cluster config will now return all of the cluster state including
servers, CQs, shards, etc.
2014-09-08 14:31:56 -04:00
Paul Dix 6ddfba6e32 Add ability to update existing shard spaces.
This will help users recover from #886. It's dangerous functionality because it only changes the metadata. Will document and tell people to use with caution.
2014-09-08 14:18:32 -04:00
Paul Dix f20f8e8f08 Update shard space to not set defaults
Fixes #886. Shard spaces would not have compiled regexes when the server is restarted and the cluster config is pulled from a raft snapshot. A call to MatchSeries would then reset the regex for the shard space. BAAAAAD.
2014-09-08 14:16:27 -04:00
Paul Dix a62e8c8b4c Add ability to update existing shard spaces.
This will help users recover from #886. It's dangerous functionality because it only changes the metadata. Will document and tell people to use with caution.
2014-09-05 16:24:00 -04:00
Paul Dix 64eedb7db0 Update shard space to not set defaults
Fixes #886. Shard spaces would not have compiled regexes when the server is restarted and the cluster config is pulled from a raft snapshot. A call to MatchSeries would then reset the regex for the shard space. BAAAAAD.
2014-09-05 14:54:56 -04:00
John Shahid e42bb3de3c Add some documentation 2014-09-03 15:10:43 -04:00
John Shahid 18dde750ab Cleanup the creation of engine processors 2014-09-03 15:10:43 -04:00
John Shahid c2d01e1f2d Simplify the response types 2014-09-03 15:10:43 -04:00
John Shahid 93e75e4c13 Add some logging 2014-09-03 15:10:43 -04:00
John Shahid 4383375fe8 Split the different engines in their own types 2014-09-03 15:10:43 -04:00
John Shahid 9c811a1761 Some cleanup 2014-09-03 15:10:42 -04:00
Paul Dix d9a14861e4 Fixes #868, panic on upgrades.
This was a problem with 0.7.x upgrades to 0.8 where there was a raft snapshot. The recovery method assumed certain structures would be there and they weren't.
2014-09-03 10:40:51 -04:00
John Shahid e662262722 Merge pull request #856 from rubenk/fix-typo
Fix a few typos
2014-08-29 13:20:25 -04:00
Paul Dix b1e6184ea1 validate that shard spaces have a non-empty regex 2014-08-22 15:01:03 -04:00
Todd Persen 73de8f18a6 Merge pull request #861 from influxdb/860-validte-shards
Update database configuration to validate shard spaces before making db
2014-08-21 17:27:41 -04:00
Paul Dix 72274002fc Update database configuration to validate shard spaces before creating anything.
Fixes #860. Update the validate method on shard spaces to optionally check if the database exists.
2014-08-21 16:59:27 -04:00
Ruben Kerkhof 471e6a2c80 Fix a few typos 2014-08-21 16:22:14 +02:00
oliveagle 8fdd988226 makes listServers api more informative 2014-08-19 17:09:23 +08:00
John Shahid db9e0d7114 When remote executing a query send the time conditions as well
Close #820
2014-08-13 12:59:21 -04:00
John Shahid 8607a60fe0 Make sure we remove the shard metadata whenever it expires 2014-08-07 13:10:12 -04:00
Paul Dix 97508402ee Move load database config to API
Fix #791 - Removed load database config options from the daemon. Created an API endpoint and updated test.
Fix #745 - Added definition of continuous queries to load database config.
Close #792
2014-08-01 16:09:00 -04:00
John Shahid c02cff22c5 Fix some bugs with retention policy of shard spaces
This commit fixes two bugs:

Don't try to parse "inf" retention policy when creating a shard
space. This caused a panic to be thrown when a shard space is created
with infinity. Fix #774

`getExpiredShards()` used shard duration to determine which shards are
expired but should be using shard retention duration instead. Close #769
2014-07-22 10:55:39 -04:00
Shugo Maeda 8646cb5a42 The attributes of a shard space should not be reverted to the defalut values when writing data into the shard space. 2014-07-17 14:13:15 +09:00
John Shahid d40a196234 Use the same ShardSpace in the server and client 2014-07-14 19:41:13 -04:00
John Shahid 39ea797dcd Fix #690. Use idiomatic go project structure
Conflicts:
	cluster/cluster_configuration.go
	cluster/shard.go
	coordinator/command.go
	coordinator/coordinator_test.go
	coordinator/raft_server.go
	daemon/influxd.go
	datastore/shard.go
	integration/single_server_test.go
	parser/query_spec.go
	server/server.go
2014-07-14 18:47:37 -04:00
John Shahid e5276112c1 Restructure the codebase to be more idiomatic 2014-06-30 11:31:08 -04:00