Commit Graph

79 Commits (adbfee28b321990d024fe1242b957aee3346666d)

Author SHA1 Message Date
Ben Johnson 8be85c154a
Allow value filtering on SHOW TAG VALUES
This commit allows users to filter on the `value` field in the
`SHOW TAG VALUES` command:

	SHOW TAG VALUES WITH KEY = "mytag" WHERE "value" = 'myvalue'

Previously this command would return all values.
2018-06-28 09:50:03 -06:00
Edd Robinson 3cb9e13d58 Address PR feedback 2018-06-13 17:41:50 +01:00
Edd Robinson 652bb3d3c3 Keep __name__ tag in results 2018-06-13 11:12:56 +01:00
Edd Robinson 1eca0093de Remove __name__ tag once parsed for measurement 2018-06-13 00:20:00 +01:00
Edd Robinson 28b6df7afb Ensure remote read can handle no data in time 2018-06-12 23:10:18 +01:00
Edd Robinson 522e509709 Add further tests 2018-06-12 15:54:18 +01:00
Jason Wilder 8730be1e9f Fix flaky test TestServer_ConcurrentPointsWriter_Subscriber
The LocalServer could be closed before the goroutine writing points
exited causing nil pointer panic.

Fixes #9583
2018-03-22 14:33:55 -06:00
Jonathan A. Sternberg f8d60a881d Refactor the math engine to compile the query and use eval
This change makes it so that we simplify the math engine so it doesn't
use a complicated set of nested iterators. That way, we have to change
math in one fewer place.

It also greatly simplifies the query engine as now we can create the
necessary iterators, join them by time, name, and tags, and then use the
cursor interface to read them and use eval to compute the result. It
makes it so the auxiliary iterators and all of their complexity can be
removed.

This also makes use of the new eval functionality that was recently
added to the influxql package.

No math functions have been added, but the scaffolding has been included
so things like trigonometry functions are just a single commit away.

This also introduces a small breaking change. Because of the call
optimization, it is now possible to use the same selector multiple times
as a selector. So if you do this:

    SELECT max(value) * 2, max(value) / 2 FROM cpu

This will now return the timestamp of the max value rather than zero
since this query is considered to have only a single selector rather
than multiple separate selectors. If any aspect of the selector is
different, such as different selector functions or different arguments,
it will consider the selectors to be aggregates like the old behavior.
2018-03-19 15:01:15 -05:00
Edd Robinson e2e0581b12 Add randomised deletion test
This commits adds a randomised deletion test, which aims to test the
correctness of deletions and drops in the index and series file.

The test works by maintaining its own index of points, series and
measurements, tracking the presence or absence or series.

There are four commands that can be randomly executed:

  - insert a series at a random time
  - drop an entire measurement
  - drop an entire series
  - delete series across a time range

After every invocation of one of these commands, `SHOW SERIES` is
executed on the server, and the results are compared to what the
test's series tracker believes should be present. If the results
differ then the test fails.

On failure, the last 100 queries executed, as well as the series
we expected, and the series returned by `SHOW SERIES`, are returned.
2018-01-15 12:00:30 +00:00
Adam 938db68198
Update restore functionality to run in online mode, consume Enterprise backup files. (#9207)
* Live Restore + Enterprise data format compatability

* Extended ImportData to import all DB's if no db name given

* Added a new enterprise data test, and backup command now prints the backup file paths at conclusion

* Added whole-system backup test

* Update to use protobuf in all enterprise data cases

* Update to test to do cross-testing with enterprise version

* incremental enterprise backup format support
2018-01-10 13:59:18 -05:00
Edd Robinson c854c67ead
Merge pull request #9283 from influxdata/er-tag-keys
Fix duplicate Tag Keys
2018-01-05 14:34:52 +00:00
Edd Robinson 7dced43f02 Unskip test 2018-01-05 12:24:27 +00:00
Edd Robinson 760a9e88ec Ensure test data deleted from disk 2018-01-02 12:51:24 +00:00
Ben Johnson 01aa11af95
circle 2017-12-22 11:30:11 -07:00
Ben Johnson f240a930c7
Preserve original mmap in series file. 2017-12-21 20:00:05 -07:00
Ben Johnson bc0d68f405
Skip estimation test for 386. 2017-12-21 16:00:13 -07:00
Ben Johnson 0afb718a11
OOM test issue 2017-12-21 13:36:32 -07:00
Ben Johnson 4d7426ebbd
Fix race bug. 2017-12-21 10:12:21 -07:00
Ben Johnson 37803d6803
Fixed 'tests' pkg. 2017-12-07 08:33:47 -07:00
Ben Johnson c36817fffc
Fix retain/release hang issues. 2017-12-06 09:09:41 -07:00
Ben Johnson 493c1ed0d1
inmem tests passing. 2017-12-05 10:49:58 -07:00
Ben Johnson f5f85d65f9
Fixing more tests. 2017-12-04 10:29:04 -07:00
Ben Johnson 01491ca4f4
intermediate 2017-11-27 07:52:18 -07:00
Edd Robinson 081d0649a6
Merge pull request #9078 from influxdata/er-race-tests
Skip cardinality tests in race mode
2017-11-07 19:52:30 +00:00
Edd Robinson 5a85f0d239 Skip cardinality tests in race mode 2017-11-07 18:55:43 +00:00
Ben Johnson 156f25ac23
Improve SHOW TAG KEYS performance. 2017-11-07 10:59:19 -07:00
Edd Robinson cce310b057 Skip SHOW TAG KEYS tests 2017-11-06 19:15:01 +00:00
Edd Robinson fbcb299b8a Support WHERE time clause in SHOW TAG VALUES
This commit adds time support to SHOW TAG VALUES. Time can be used as
both a lower and upper boundary. However, there are some caveats.

For the `inmem` index, filtering by time will still return all results
because the index data is shared across shards.

For the `tsi1` index, filtering by time will only work down to the shard
lever. Specifically, when querying by time all shards within that time
range will be used to generate the results.
2017-11-06 19:15:01 +00:00
Edd Robinson f97f5bcc82 Add time based meta query tests 2017-11-06 19:15:00 +00:00
Edd Robinson 5f4708e7ca Split out SHOW TAG KEYS/VALUES tests 2017-11-06 19:15:00 +00:00
Edd Robinson 98d584b63f Use index for SHOW X meta queries
When a meta query does not include a time component then it can be
answered exclusively by the index. This should result in a much faster
query execution that if the TSM engine was engaged.

This commit rewrites the following queries such that they make use
of the index where no time component is present:

  - SHOW MEASUREMENTS
  - SHOW SERIES
  - SHOW TAG KEYS
  - SHOW FIELD KEYS
2017-11-06 19:15:00 +00:00
Edd Robinson bda6de9817 Add all versions of CARDINALITY commands 2017-10-26 16:22:48 +01:00
Edd Robinson ba9506764c SHOW FIELD KEY EXACT CARDINALITY 2017-10-26 16:22:31 +01:00
Edd Robinson c57e192984 SHOW TAG VALUES EXACT CARDINALITY 2017-10-26 16:22:31 +01:00
Edd Robinson 47c0840d5b SHOW TAG KEY EXACT CARDINALITY 2017-10-26 16:22:31 +01:00
Edd Robinson f80591bfa1 Implement MEASUREMENT cardinality estimation 2017-10-26 16:22:31 +01:00
Edd Robinson 3079b41f00 Implement series cardinality estimation 2017-10-26 16:22:31 +01:00
Edd Robinson 89a0ddf689 Add EXACT CARDINALITY variation 2017-10-26 16:22:31 +01:00
Jonathan A. Sternberg 194939bbfc Add an integration test for writing the uint protocol and reading it 2017-10-09 11:00:21 -05:00
Jonathan A. Sternberg f20cab6e99 Implicitly decide on the lower limit for fill queries when none is present
This allows the query:

    SELECT mean(value) FROM cpu GROUP BY time(1d)

To function in some way that makes sense. The upper limit is implicitly
the `now()` starting time and the lower limit will be whichever interval
the lowest point falls into.

When no lower bound is specified and `max-select-buckets` is specified,
the query will only consider points that would satisfy
`max-select-buckets`. So if you have one point written in 1970, have
another point within the last minute, and then do the above query with
`max-select-buckets` being equal to 10, the older point from 1970 will
not be considered.
2017-10-05 15:56:44 -05:00
Jonathan A. Sternberg 06994a6585 Revert "Convert duration to string without dot and zeros" 2017-10-02 16:31:03 -05:00
liketic 986a0e18da Convert duration to string without dot and zeros 2017-09-28 11:56:25 -05:00
Jonathan A. Sternberg bcf2e8fca5 Prevent deadlock when doing math on the result of a subquery
The `fill(none)` attribute got set on subqueries, but that can cause an
issue with certain subqueries just like it caused a deadlock on outer
queries.
2017-09-22 14:45:53 -05:00
Edd Robinson 44691847e9 Merge branch 'master' into er-8678-tsi1-where 2017-09-22 16:54:49 +01:00
Ben Johnson 1dbe0662d8
Use system cursors for measurement, series, and tag key meta queries. 2017-08-30 08:35:20 -06: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
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 d011e43a1b Address feedback 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 f64f6c5d34 Ensure all tests are ran for both indexes 2017-08-22 17:39:45 +01:00