Commit Graph

12471 Commits (d474a0ed9cdc569c30bd7398240cb0c3de11d9e2)

Author SHA1 Message Date
Stuart Carnie 0ced270197 fix race condition reading map 2017-08-28 13:36:49 -07:00
Jonathan A. Sternberg dad6d95bf8 Merge pull request #8753 from influxdata/js-explain-walk
Walk through the explain statement
2017-08-28 14:24:57 -05:00
Jonathan A. Sternberg 47fd076b1d Walk through the explain statement 2017-08-28 12:45:39 -05:00
Jonathan A. Sternberg 37f4a7b19b Merge pull request #8751 from influxdata/js-explain-ast
Update parser and AST for explain statement
2017-08-28 12:02:30 -05:00
Jonathan A. Sternberg 5593eecda6 Update parser and AST for explain statement 2017-08-28 11:36:06 -05:00
Jonathan A. Sternberg 5dbcd1b06f Merge pull request #8745 from influxdata/js-refactor-validation
Refactor validation code and move it to the compiler
2017-08-28 11:35:24 -05:00
Jonathan A. Sternberg 285bdf3542 Merge pull request #8750 from influxdata/js-close-shard-group-after-creating-iterators
Close the query shard group after the iterators are created
2017-08-28 11:35:07 -05:00
Jonathan A. Sternberg d2fcb893e1 Close the query shard group after the iterators are created
Now, the prepared statement keeps the open resource and closing the open
resource created from `Prepare` is the responsibility of the prepared
statement.

This also nils out the local shard mapping after it is closed to prevent
it from being used after it is closed.
2017-08-28 09:46:11 -05:00
Jonathan A. Sternberg 5cdd1b1489 Fix the panic message for the new interval iterator 2017-08-26 17:36:32 -05:00
Jonathan A. Sternberg ef0ad3292d Remove unused functions in influxql/ast.go 2017-08-26 17:36:32 -05:00
Jonathan A. Sternberg 905e7fe05e Refactor validation code and move it to the compiler
This refactors the validation code so it is more flexible and performs a
small bit of work to make preparing and executing the query easier.

The general idea is that compilation will eventually do more heavy
lifting in creating the initial plan and prepare will construct an
actual plan rather than just doing some basic field rewriting.

This change at least sets us up for that change in the future and moves
the validation code to the query execution instead of in the parser.

This also frees up the parser to parse the complete AST without worrying
if the query itself is valid. That could be useful for client code that
wants to compile a partial query to an AST and then perform
modifications on the AST for some reason.
2017-08-26 17:36:32 -05:00
Jonathan A. Sternberg b61b030b8c Merge pull request #8744 from influxdata/js-refactor-select
Refactor the select call into three separate phases
2017-08-26 17:33:48 -05:00
Jonathan A. Sternberg 8738e72cf1 Refactor the select call into three separate phases
The first call is to compile the query. This performs some initial
processing that can be done before having any access to the shards. At
the moment, it does very little, but it's intended to be changed to
eventually perform initial validations of the query and create an
internal graph structure for the execution of the query.

The second call is to prepare the query. This step has access to the
shard mapper. Right now, it just maps the shards and rewrites the fields
of the query for any wildcards. In the future, it is intended to do the
above, but also to prepare the final directed acyclical graph that will
execute the query.

The third call is to select the query. This step is intended to create
all of the iterators for processing the query. At the moment, much of
the work intended for the second step is performed in the third step.
2017-08-25 07:50:13 -05:00
Jonathan A. Sternberg f7724b780a Add benchmark tests back 2017-08-25 07:50:02 -05:00
Jonathan A. Sternberg d46e8ffdae Merge pull request #8740 from influxdata/js-map-shards-interface
Pass the select options to the shard mapper again
2017-08-24 12:26:15 -05:00
Jonathan A. Sternberg 421a91d480 Pass the select options to the shard mapper again 2017-08-24 09:55:02 -05:00
Ben Johnson bd2963dc05 Merge pull request #8735 from influxdata/er-8695-iterators
Ensure that sorted heaps are merged correctly
2017-08-24 08:45:16 -06:00
Jonathan A. Sternberg 0eabef6c5d Merge pull request #8737 from influxdata/js-influxql-protobuf
Add back the protobuf marshaling inside of influxql
2017-08-24 09:40:48 -05:00
Edd Robinson 49d9077a61 Merge pull request #8734 from influxdata/er-8668-toml
Bump toml parser to relicensed MIT version
2017-08-24 11:03:14 +01:00
Jonathan A. Sternberg 9cba52b675 Add back the protobuf marshaling inside of influxql 2017-08-23 15:37:46 -05:00
Edd Robinson 8c4686fb1b Ensure that sorted heaps are merged correctly
When merging streams of system iterators we don't use tags or time.
Instead we add series keys (in the case of, for example, `SHOW SERIES`)
to the `Aux` field of the iterators' elements. This is because we only
emit merged and sorted sets of series key to the client.

We currently use `SortedMergeHeap`s to merge together multiple
iterators, and the comparitor function did not consider `Aux` fields
when determining which heap to pop the next item off during a merge. As
such, `SHOW SERIES` and `SHOW TAG KEYS` (any meta query that gets
converted into a special type of `SELECT`) were returning results in
arbitrary order.

This issue was never noticed on the `inmem` index because the streams
are always duplicates of each other, and of course it doesn't matter if
you arbitrarily merge together two idential, sorted streams...

The issue first manifested itself on the `tsi1` index, but this fix will
apply to both indexes.
2017-08-23 17:21:24 +01:00
Edd Robinson 6e3b8d4684 Merge branch 'master' into er-8668-toml 2017-08-23 17:16:31 +01:00
Jonathan A. Sternberg ae66d327a7 Merge pull request #8736 from influxdata/js-refactor-select
Move query engine code from the statement executor to the query engine
2017-08-23 10:50:40 -05:00
Jonathan A. Sternberg 96689e661e Move query engine code from the statement executor to the query engine
The statement rewriting logic should be in the query engine as part of
preparing a query. This creates a shard mapper interface that the query
engine expects and then passes it to the query engine instead of
requiring the query to be preprocessed before being input into the query
engine. This interface is (mostly) the same as the old interface, just
moved to a different package.
2017-08-23 10:07:30 -05:00
Jonathan A. Sternberg e91d38b117 Merge pull request #8730 from influxdata/js-refactor-select-tests
Refactor the select tests to use subtests and fewer functions
2017-08-23 10:02:36 -05:00
Edd Robinson e24ff1d13c Merge pull request #8619 from influxdata/er-8611-request-id
Support pre-existing request ID headers
2017-08-23 14:46:05 +01:00
Jonathan A. Sternberg 966e845c03 Refactor the select tests to use subtests and fewer functions
This will allow refactoring the query engine and the select statement
more easily since fewer code locations will need to be changed. It also
reduces the amount of code while still keeping individual tests that are
filterable.
2017-08-23 08:21:49 -05:00
Edd Robinson 64933fea17 Support pre-existing request ID headers
Other applications or services sometimes expose a header containing a
unique ID, which can then be included in logging or response information
to allow an operator to link inter-service requests. The most common
header name used by services in the wild appears to be `X-Request-ID`,
but `Request-Id` is also used.

This commit adds support for specifying either `X-Request-ID` or
`Request-Id` headers, which will then be used by InfluxDB when logging
request information, and also in the `X-Request-ID` and `Request-Id`
response headers.

We populate both `X-Request-ID` and `Request-Id` to maintain backwards
compatibility with previous version, and to support the more common
`X-Request-ID` header name.

If both `X-Request-ID` and `Request-Id` are specified, then
`X-Request-ID` is used.

If neither header is specified, then in line with previous behaviour, we
generate a v1 UUID.
2017-08-23 13:42:33 +01:00
Edd Robinson 36ed3cbb22 Merge pull request #8685 from influxdata/er-8663-tsi1-tests
Run relevant unit tests on both indexes
2017-08-23 12:17:08 +01:00
Edd Robinson 45a6e53d7b Bump toml parser to relicensed MIT version 2017-08-23 11:00:31 +01:00
Edd Robinson d011e43a1b Address feedback 2017-08-23 10:47:01 +01:00
Edd Robinson a5f4b929c9 Ensure Skip is called in test goroutine 2017-08-23 10:47:01 +01:00
Edd Robinson 74297a38d6 CHANGELOG 2017-08-23 10:47:01 +01:00
Edd Robinson 9be7c5aaa6 Run relevant engine tests on both indexes 2017-08-23 10:47:01 +01:00
Edd Robinson 9c12607c3e Ensure shard tests run with both indexes 2017-08-23 10:46:59 +01:00
Edd Robinson e732cb7a39 Update benchmarks to use sub-benchmarks 2017-08-22 17:51:48 +01:00
Edd Robinson dd808bb77a Ensure TSI tests run with TSI index 2017-08-22 17:51:48 +01:00
Edd Robinson bca4393494 Run most tests for both indexes 2017-08-22 17:51:48 +01:00
Edd Robinson f64f6c5d34 Ensure all tests are ran for both indexes 2017-08-22 17:39:45 +01:00
Edd Robinson 84aea2718a Reduce noise in test logs
This commit reduces noise in the test logs by adding a -vv flag, and
silencing server log output, even when verbose testing mode is enabled.

Verbose testing mode (-v) is useful for seeing where sub-tests may be
failing, but it's currently too noisy with the server logs.

The -vv flag can now be used to see all server output. The flag should
be placed _after_ the package you're testing, e.g.,

    go test github.com/influxdata/influxdb/tests -vv
2017-08-22 17:39:45 +01:00
Edd Robinson aacdb9bed2 Convert tests to use sub-tests 2017-08-22 17:39:45 +01:00
Jason Wilder d305b89f74 Merge pull request #8726 from influxdata/jw-tsm-file-leak
Fix leaking tmp file when large compaction aborted
2017-08-22 09:59:23 -05:00
Stuart Carnie 2ef9b489f0 Merge pull request #8727 from influxdata/sgc-finalizer
log message when iterator is closed by finalizer
2017-08-22 07:29:38 -07:00
Stuart Carnie d189621d07 log message when iterator closed by finalizer 2017-08-21 16:46:24 -07:00
Jason Wilder e265d150be Fix leaking tmp file when large compaction aborted
If a large compaction was running and was aborted. It could would leave
some tmp files around for files that it had fully written.  The current
active file was cleaned up, but already completed ones would not.  This
would occur when a TSM file needed to rollover due to size.
2017-08-21 17:04:57 -06:00
Jonathan A. Sternberg 5ce6007347 Merge pull request #8724 from influxdata/js-remove-unused-cursor
This cursor implementation appears to be completely unused
2017-08-21 17:44:51 -05:00
Jonathan A. Sternberg c0f7a8af5b This cursor implementation appears to be completely unused
Remove it so that its existence doesn't confuse someone that this is
actually the cursor. The real cursors appear to be in file_store.gen.go.
2017-08-21 16:27:23 -05:00
Stuart Carnie abf87f8373 Merge pull request #8716 from influxdata/sgc-finalizers
Ensure inputs are closed on error. Add runtime GC finalizer as additional guard to close iterators
2017-08-18 07:41:43 -07:00
Stuart Carnie 25edd7bfdf naming 2017-08-17 15:47:47 -07:00
Stuart Carnie 4233763321 update CHANGELOG 2017-08-17 11:12:48 -07:00