Commit Graph

181 Commits (80cd5e63af7c39ff111c91c7fdbcf0eb8bf49655)

Author SHA1 Message Date
Jason Wilder f9379eddf2 Drop data before updating meta store
If a drop statement failed to remove state on disk, the meta store
would still be updated and you would not be able to retry the delete
leaving orphaned data around.

This reverses the logic so the data must be removed before the meta
store is updated.
2016-06-07 12:14:04 -06:00
Jonathan A. Sternberg fe3f0d0e3d Remove the DatabaseIndex method from TSDBStore interface
The TSDBStore interface needs to also allow for remote TSDBStore but the
DatabaseIndex is only for a local TSDB instance. Moved the optimized
SHOW TAG VALUES path to do a typecast to the LocalTSDBStore struct
instead of always attempting to use the optimized version.

If the TSDBStore is not local and does not have the DatabaseIndex, it
will default to using the distributed query instead.
2016-06-07 11:34:34 -05:00
Jonathan A. Sternberg b972c220aa Merge pull request #6757 from influxdata/js-refactor-execute-query
Refactor ExecuteQuery to take options as a struct
2016-06-07 10:35:52 -05:00
Ben Johnson 1b94cd2686
optimize SHOW TAG VALUES
This commit optimizes `SHOW TAG VALUES` so that it avoids the
`SELECT` query engine execution and iterator creation. There
are also optimizations to reduce individual memory allocations
and to reduce in-memory heap size by only operating on one
measurement at a time.

Execution time has been reduce to approximately 900ms for
500,000 rows. This is about 2µs per row. Of this time,
approximately 1µs is spent retrieving and sorting the row
and 1µs is spent encoding into JSON and writing to the
response body.
2016-06-06 15:50:53 -06:00
Jason Wilder a74ea4cbf4 Allow creating shards in a disable state
For restoring a shard, we need to be able to have the shard open,
but disabled.  It was racy to open it and then disable it separately
since writes/queries could occur in between that time.
2016-06-01 16:17:18 -06:00
Jonathan A. Sternberg 71c8e9e567 Refactor ExecuteQuery to take options as a struct
This allows us to add additional options to ExecuteQuery without
creating parameter bloat.

Removing the unused Series structs. Their necessity was removed by a
previous commit, but the structs were not removed yet.

Add another type of interrupt iterator that monitors the interrupt
channel and calls `Close()` on the iterator when the interrupt happens.
It will primarily be used for asynchronously closing the ReaderIterator,
but it will only close the read side of the connection properly. More
work needs to be done to allow closing the write side efficiently.
2016-06-01 12:30:52 -05:00
David Norton 62f3b4486a batch SELECT INTO writes 2016-06-01 12:05:23 -04:00
Edd Robinson f4fc905fa9 Reject timestamps too far in future 2016-05-27 11:07:48 +01:00
Edd Robinson bc6e1e84af Change max time for SHOW meta queries
If all points in a series are timestamped in the future, the SHOW
queries will not return anything from these series.

This commit changes the to time used when querying shards for the SHOW
queries to the maximum time, in order to ensure future points are
considered in the results for these queries.

Fixes #6599.
2016-05-26 23:22:23 +01:00
Jonathan A. Sternberg 1518e5eb2c Update IF NOT EXISTS and IF EXISTS deprecated message
Removed the version that it would be removed in as we will not be
removing it for 1.0.
2016-05-24 09:50:23 -04:00
David Norton b32208a850 fix #2048: check that RPs exist before creating CQ 2016-05-20 12:40:36 -04:00
Edd Robinson 19e781fe24 Merge pull request #6639 from influxdata/er-hh-tidy
Remove references to Hinted Handoff
2016-05-17 12:19:08 +01:00
Jonathan A. Sternberg 23f6a706bb Support cast syntax for selecting a specific type
Casting syntax is done with the PostgreSQL syntax `field1::float` to
specify which type should be used when selecting a field. You can also
do `field1::field` or `tag1::tag` to specify that a field or tag should
be selected.

This makes it possible to select a tag when a field key and a tag key
conflict with each other in a measurement. It also means it's possible
to choose a field with a specific type if multiple shards disagree. If
no types are given, the same ordering for how a type is chosen is used
to determine which type to return.

The FieldDimensions method has been updated to return the data type for
the fields that get returned. The SeriesKeys function has also been
removed since it is no longer needed. SeriesKeys was originally used for
the fill iterator, but then expanded to be used by auxiliary iterators
for determining the channel iterator types. The fill iterator doesn't
need it anymore and the auxiliary types are better served by
FieldDimensions implementing that functionality, so SeriesKeys is no
longer needed.

Fixes #6519.
2016-05-16 12:08:29 -04:00
Edd Robinson 5249bdffd6 Remove references to Hinted Handoff 2016-05-16 16:48:58 +01:00
Jason Wilder a89a4d6b40 Add PointsWriter write timeout back
Was ignored for some reason.
2016-05-11 12:59:51 -06:00
Jason Wilder db7d58c867 Remove old cluster config options 2016-05-11 12:59:30 -06:00
Jason Wilder 6cc1a34704 Rename cluster package to coordinator 2016-05-11 11:41:05 -06: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 1f3570536f Don't try to close the protobuf server if it's not open
Fix #584
2014-11-05 16:46:54 -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 3a857296f4 Support joining multiple series using regex or list 2014-10-31 14:49:48 -04:00
David Norton 4b59ddd113 Don't try to take 2 snapshots at a time
Fix #943. Close #1081
2014-10-31 14:00:56 -04:00
John Shahid bdcaef1ded Set the node's connection string when creating a new raft server 2014-10-31 13:54:20 -04:00
John Shahid f9b3a27345 Make the raft logging configurable 2014-10-30 16:03:13 -04:00
David Norton 9786d31db3 Add func to get str desc of Processor chain
Close #1068
2014-10-29 16:39:04 -04:00
Ben Johnson ec0835c256 Refactor user commands. 2014-10-28 20:30:21 -06:00
Ben Johnson 3a0e1b817c Add database listing. 2014-10-27 18:16:03 -06:00
Ben Johnson 2722e89299 Add user listing. 2014-10-27 17:31:45 -06:00
Ben Johnson 4b276bada3 Refactor messaging error handling. 2014-10-24 17:45:02 -06:00
John Shahid 6802eda768 Rename MergeFun to MergeRegex 2014-10-22 17:58:04 -04:00
John Shahid cace54d8c8 Make sure the query string has valid regex and add a test 2014-10-22 16:41:08 -04: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
David Norton ef50442d9d Fix #1040: fix panic when snapshot dir doesn't exist 2014-10-20 20:17:02 -04:00
David Norton 5e9750f7a6 Revert to older snapshots if the latest raft snapshot is corrupted
Fix #1040
2014-10-20 18:37: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 2e01f603e9 Merge branch 'master' of https://github.com/influxdb/influxdb into streaming-raft 2014-10-16 13:33:02 -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
Todd Persen f16f4b6639 Querying for data outside of existing shards should return an empty response.
Fix #1004. Close #1023
2014-10-14 12:59:47 -04:00
Ben Johnson 4dd03b6e06 Add influx log. 2014-10-01 20:49:21 -06:00
John Shahid 706282faf6 fix a merge conflict that wasn't caught in 0ca44c9 2014-09-24 19:04:11 -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
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 9b9ac93652 Fix parsing of multiple queries
Fix #885
2014-09-24 17:25:19 -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
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 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
John Shahid c45960aa1f use gocheck in the coordinator benchmark 2014-09-04 15:24:57 -04:00
John Shahid e42bb3de3c Add some documentation 2014-09-03 15:10:43 -04:00
John Shahid 0a0b14ba23 Remove more constants 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 2a997d2648 Clean up 2014-09-03 15:10:43 -04:00
John Shahid 843c16e196 Write to the buffer instead of using append 2014-09-03 15:10:43 -04:00
John Shahid 500eccc503 No need for a function variable 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 d68a798454 Move permission checking to permissions 2014-09-03 15:10:43 -04:00
John Shahid f44b83f3ae Use separate file 2014-09-03 15:10:43 -04:00
John Shahid d696e5493c Remove some cruft 2014-09-03 15:10:43 -04:00
John Shahid bb710e0977 Get rid of the unnecessary extra argument 2014-09-03 15:10:42 -04:00
John Shahid 598dcdb7fd Don't overuse interfaces if there's no benefit 2014-09-03 15:10:42 -04:00
John Shahid 9c811a1761 Some cleanup 2014-09-03 15:10:42 -04:00
John Shahid 87b4554149 Merge pull request #887 from influxdb/fix-887
If the first continuous query to ever run on InfluxDB had backfill(false) InfluxDB will still backfill the data
2014-09-02 13:41:01 -04:00
John Shahid 127249229d Don't accidentally trigger continuous query backfilling 2014-09-02 13:27:09 -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
oliveagle 9117ae789b GetLeaderRaftConnectString returns consistent result 2014-08-22 01:30:48 +08: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
Paul Dix 5403baffd3 Add data migration 0.7 -> 0.8
Close #809. Fix #746
2014-08-15 13:20:49 -04:00
John Shahid 34732ad598 Fix the build 2014-08-12 14:50:55 -04:00
John Shahid 49122da251 List series should support filtering by a regex 2014-08-11 16:59:11 -04:00
John Shahid 8607a60fe0 Make sure we remove the shard metadata whenever it expires 2014-08-07 13:10:12 -04:00
John Shahid e349e22d42 Fix a unit test that has changed in 91078c0
Non admin database users shouldn't be able to drop series. See #736 for
more details
2014-07-22 15:54:16 -04:00
John Shahid 91078c0d21 Non admin database users shouldn't be able to drop series
Fix #736
2014-07-22 13:33:51 -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