Commit Graph

206 Commits (40c49734233cabd03fc748b273d1b11a0df90858)

Author SHA1 Message Date
Jonathan A. Sternberg ad7480e64b Limit bucket count in selection
Fixes #6078.
2016-03-30 22:57:09 -04:00
Jonathan A. Sternberg eb467d8d7f Merge pull request #6126 from influxdata/js-6115-chunked-query-support-mid-series
Support chunking in the middle of a series in the emitter
2016-03-30 20:59:24 -04:00
Jason Wilder 5e6247ac58 Fixed consistency level parameter being ignored
The http handler consistency level parameter was removed and hard-coded
to "any."  It needs to be read and passed through to the points writer.
2016-03-30 16:37:58 -06:00
Jonathan A. Sternberg 711a6614e6 Implement the point limit monitor
Fixes #6077.
2016-03-30 16:08:56 -04:00
Jonathan A. Sternberg 3e93689020 Prototype for returning custom errors from the query manager 2016-03-30 16:08:55 -04:00
Jonathan A. Sternberg 364dce36ab Support chunking in the middle of a series in the emitter
Limit the maximum size of the return value when chunking is not used to
prevent the server from going out of memory.

Fixes #6115.
2016-03-30 14:36:35 -04:00
Tait Clarridge 45b3e61ac7 Add configurable shard duration to retention policies
Allows configuration of shard group duration at database creation, and retention
policy create/alter time.

Query examples:

```
CREATE DATABASE testdb WITH DURATION 90d SHARD DURATION 30m NAME rp_testdb
CREATE RETENTION POLICY rp_testdb2 ON testdb DURATION INF REPLICATION 1 SHARD DURATION 30m
ALTER RETENTION POLICY rp_testdb2 ON testdb SHARD DURATION 1h
```

This can be useful with long duration retention policies with lots of data, where
you can split into smaller shards to relieve memory pressure.
2016-03-24 00:25:49 -04:00
Ben Johnson a6d9930b6f limit series count in selection
This commit adds a configurable limit to the number of series that
can be returned from a `SELECT` statement. The limit is checked
immediately after planning and is determined by the use of iterator
stats.

Fixes #6076
2016-03-23 12:48:48 -06:00
Jonathan A. Sternberg 79fe4490c2 Support a timeout for running queries in the query manager
Include an interrupt iterator at the top level to interrupt the fill
iterator if it is producing too many points.

Fixes #6075.
2016-03-22 13:30:40 -04:00
Jonathan A. Sternberg abae1cfed0 Limit the maximum number of concurrent queries
Fixes #6079.
2016-03-21 22:34:27 -04:00
Ben Johnson 7156c1f9bd add IteratorStats
This commit adds an `IteratorStats` that holds aggregate
iterator processing information. A method is also added to
`Iterator` to return the stats:

	Stats() influxql.IteratorStats

The remote iterators will also emit their stats in the point
stream upon first connection, on a given interval, and then
finally once the last point has been sent.
2016-03-21 16:25:19 -06:00
Jonathan A. Sternberg 6655ca7769 Create a new interrupt iterator that will stop emitting points after an interrupt
Use of the iterator is spread out into both `IteratorCreators` and
inside of the iterators themselves. Part of the interrupt must be
handled inside of the engine so it stops trying to emit points when an
interrupt is found and another part of the interrupt has to happen when
combining the iterators so it doesn't just start reading the next shard.
2016-03-21 12:07:07 -04:00
Jonathan A. Sternberg 3e580bcf04 Allow a query to be killed
While this allows a query to be killed, it doesn't really do anything
yet since the interrupt happens only after the first row gets emitted
(the entire first series).

This section of code will likely have to be refactored to make this work
since we need a way to interrupt a currently running iterator.
2016-03-21 12:07:06 -04:00
Jonathan A. Sternberg 117f62c33e Implement a simple task manager for queries
The currently running queries can be listed with the command
`SHOW QUERIES` and it will display the current commands that have been
run, the database they were run against, and how long they have been
running.
2016-03-21 12:06:06 -04:00
Edd Robinson f4f20f17f2 Wire up DROP SHARD to executor 2016-03-14 23:47:55 +00:00
Edd Robinson e5a41f7796 DROP SHARD 2016-03-14 22:59:55 +00:00
Cory LaNou d024ca2552 modify WritePoints function signature for p products 2016-03-14 16:55:54 +00:00
Cory LaNou 43e345cf4d fix error in write 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
Ben Johnson beda072426 add support for remote expansion of regex
This commit moves the `tsdb.Store.ExpandSources()` function onto
the `influxql.IteratorCreator` and provides support for issuing
source expansion across a cluster.
2016-03-11 12:40:07 -07:00
Ben Johnson 41dde61226 SHOW SERIES 2016-03-08 11:47:57 -07:00
Jason Wilder a54befbd96 Fix comment typo 2016-03-02 09:22:20 -07:00
Jason Wilder a1c9ce67d6 Switch remote write logic back to original version
CreateShard is expensive and should not be called for every write
request.
2016-03-01 21:23:28 -07:00
Jason Wilder 43118ce78e Send database and retention policy with remote writes
There was a race where a remote write could arrive before a meta
client cache update arrived.  When this happened, the receiving node
would drop the write because it could not determine what database
and retention policy the shard it was supposed to create belonged
to.

This change sends the db and rp along with the write so that the
receiving node does not need to consult the meta store.  It also
allows us to not send writes for shards that no longer exist instead
of always sending them and having the receiving node logs fill up
with dropped write requests.  This second situation can occur when
shards are deleted and some nodes still have writes queued in hinted
handoff for those shards.

Fixes #5610
2016-03-01 21:23:03 -07:00
Jonathan A. Sternberg aa0b603938 Convert `SHOW FIELD KEYS` to the new query engine
Fixes #5579.
2016-02-25 18:31:02 -05:00
Jonathan A. Sternberg cddc1b2241 Fix remote execution for partially replicated clusters
The RPC handler for remote queries would attempt to reuse a closed
connection for certain commands that didn't use pooling. The RPC
commands that close the connection have been fixed to not try reusing
the connection.

When creating an iterator, if there are no points to return, the points
decoder would hit an EOF that it didn't catch and would return that
error back to the client who made the request. It now properly returns
no points by using a `nilFloatIterator` if there are no points to
return.

This fixes remote execution when a cluster has nothing to return.
2016-02-25 17:46:51 -05:00
Ben Johnson 16eea8eecc add SeriesList marshaling 2016-02-25 15:38:16 -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
David Norton b30647667b fix MetaExecutor max write connections 2016-02-24 11:24:45 -05:00
David Norton 0022cfe6fd add test for meta.MetaExecutor.ExecuteStatement 2016-02-24 11:24:45 -05:00
David Norton 13b3567449 check number of nodes in meta_executor 2016-02-24 11:24:45 -05:00
Edd Robinson f9c95ad266 More useful error message for node failure 2016-02-24 11:24:45 -05:00
David Norton bb97bb86d4 remove cruft from defer conn close 2016-02-24 11:24:45 -05:00
Edd Robinson 8add49fd96 Ensures meta queries work in clusters.
Fixes #5612, #5573 and #5518.

Using the MetaExecuter, queries that need to run on both data nodes
and optionally the meta store will be executed across all data nodes
in the cluster.
2016-02-24 11:24:45 -05:00
David Norton 4d4e382ddf Add a Meta Executor.
The Meta Executor will make allow data nodes to execute queries
remotely on each other, via RPC calls.
2016-02-24 11:24:22 -05: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
Mark Rushakoff 691a2a97f0 Track queries active, query duration stats 2016-02-17 16:11:30 -08:00
Ben Johnson eb221a5adb Merge pull request #5663 from benbjohnson/query-executor
Refactor QueryExecutor (WIP)
2016-02-17 16:30:20 -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
Ady af17b9d8a7 Zero timeout set to support all platforms 2016-02-16 21:21:39 +05:30
Ady 58cccaa202 Update timeout for Dial, in order to work in Windows 2016-02-15 22:22:44 +05:30
Ady b850c13dc5 Modify Dial timeout in test to 0 nano sec to make it pass in Windows 2016-02-15 21:40:13 +05:30
Ady 80a2874361 Merge branch 'master' of https://github.com/influxdata/influxdb into mvadu-patch-ErrDialTimeout
Accomodate name change from influxdb->influxdata
2016-02-13 23:01:01 +05:30
Ady 0a00a59f28 test with more data points 2016-02-11 07:50:15 +05:30
Ady e68dd9a85a Modify WriteTLV with debug prints. Revert chnages to shard_writer 2016-02-11 07:29:47 +05:30
Ben Johnson d9a6a7340f add canonical paths 2016-02-10 11:30:52 -07: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 5c33b9d786 remove Mapper test references 2016-02-10 09:40:30 -07:00
Ben Johnson cde973f409 refactor query engine 2016-02-10 09:40:24 -07:00
Adarsha 1c7d29b79b Add 1ns delay
Windows does not timeout when the timeout is set to 1Nano sec. This causes TestShardWriter_Write_ErrDialTimeout to fail in Windows.

```go
=== RUN TestShardWriter_Write_ErrDialTimeout
[cluster] 2016/02/10 09:32:30 Starting cluster service
[cluster] 2016/02/10 09:32:30 accept remote connection from 127.0.0.1:57034
[cluster] 2016/02/10 09:32:30 unable to read type-length-value read message type: WSARecv tcp 127.0.0.1:57033: use of closed network connection
[cluster] 2016/02/10 09:32:30 close remote connection from 127.0.0.1:57034
[cluster] 2016/02/10 09:32:30 cluster service accept error: network connection closed
--- FAIL: TestShardWriter_Write_ErrDialTimeout (0.00s)
	shard_writer_test.go:162: expected error <nil>, to contain i/o timeout
```
2016-02-10 09:34:53 +05:30