Commit Graph

119 Commits (95e1e3b332fae50c1eb113b3421ae71168c034ad)

Author SHA1 Message Date
Jason Wilder 5a45059f5b Fix Panic in TestServer_ConcurrentPointsWriter_Subscribe
If the server is closed an write is sent, the LocalServer panics.
2017-11-28 08:24:28 -07:00
Edd Robinson 6851db3fc9 Add FGA support to SHOW MEASUREMENTS 2017-11-17 11:06:43 +00: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 e69217440b Remove noisy log line 2017-11-07 10:50:49 +00: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
Stuart Carnie f3d45ba301 influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
Stuart Carnie 7435725e05 move RewriteStatement and neldermead to influxdb/query package 2017-10-30 10:24:15 -07: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
Stuart Carnie 415ed14c53 storage service
* storage service is disabled by default
* default port 8082
* RPC interface generated using yarpc via service.proto
2017-10-25 13:38:07 -07: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
Joe LeGasse 1443b22379 auth: add series auth to 'show tag values' 2017-09-27 20:01:18 -04:00
Edd Robinson 660c2f8ae2 Merge pull request #8847 from influxdata/er-8842-engine-races
Fix various engine races
2017-09-25 18:34:29 +01:00
Edd Robinson 2c43654552 Add some tests for concurrent server access 2017-09-25 17:42:30 +01: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
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
Ben Johnson 60ab1282ea
Refactor system iterators.
Previously pseudo iterators could be created for meta data such
as series, measurement, and tag data. These iterators were created
at a higher level and lacked a lot of the power of the query engine.

This commit moves system iterators down to the series level and
supports the following:

	- _name
	- _seriesKey
	- _tagKey
	- _tagValue
	- _fieldKey

These can be used as normal fields such as:

	SELECT _seriesKey FROM cpu

This will return all the series keys for `cpu`.
2017-08-16 09:27:29 -06:00
Edd Robinson 45969ef3c6 Allow tag filtering when using DELETE with tsi1 2017-08-14 19:09:36 +01:00
Jason Wilder 94a48774b7 Pull in new index filter 2017-08-02 14:10:52 +01:00
Ryan Betts 19ef39d947 Merge pull request #8437 from influxdata/jl-points-auth
Fine Grained Authorization
2017-05-31 10:23:49 -04:00
Jonathan A. Sternberg 78a32cba0e Queries for `bottom()` with no tags got messed up while changing the implementation
It didn't properly pass the variable reference when creating the
variable iterator so a null iterator got passed back instead.

Duplicate the `top()` tests in TopInt to also test `bottom()` with the
same queries so `bottom()` stops getting neglected so often.
2017-05-30 11:28:41 -05:00
Stuart Carnie 8d8a7a0bfe pass meta.User to avoid future search requests 2017-05-26 15:05:38 -07:00
Joe LeGasse 815f740f4c initial fga work
wip

wip

fix tests / build
2017-05-26 13:16:27 -07:00
Jonathan A. Sternberg 9edf236cc8 Maintain the tags of points selected by top() or bottom() when writing the results
When a `SELECT ... INTO ...` is used with `top()` or `bottom()` used
with tags, the points will be written with the tags still intact instead
of converted to fields.
2017-05-23 15:00:21 -05:00
Jonathan A. Sternberg 062fab8f59 Add test cases for older issues that are now resolved
The test cases demonstrate that the following issues are resolved
through some newer features.

Related to #813, #5095, #2467, #5345, and #5150.
2017-05-18 16:49:45 -05:00
Jonathan A. Sternberg df30a4d9c9 Refactor the subquery code and fix outer condition queries
This change refactors the subquery code into a separate builder class to
help allow for more reuse and make the functions smaller and easier to
read.

The previous function that handled most of the code was too big and
impossible to reason through.

This also goes and replaces the complicated logic of aggregates that had
a subquery source with the simpler IteratorMapper. I think the overhead
from the IteratorMapper will be more, but I also believe that the actual
code is simpler and more robust to produce more accurate answers. It
might be a future project to optimize that section of code, but I don't
have any actual numbers for the efficiency of one method and I believe
accuracy and code clarity may be more important at the moment since I am
otherwise incapable of reading my own code.
2017-04-28 17:12:32 -05:00
Jonathan A. Sternberg addc12561f Fix LIMIT and OFFSET for certain aggregate queries
When LIMIT and OFFSET were used with any functions that were not handled
directly by the query engine (anything other than count, max, min, mean,
first, or last), the input to the function would be limited instead of
receiving the full stream of values it was supposed to receive.

This also fixes a bug that caused the server to hang when LIMIT and
OFFSET were used with a selector. When using a selector, the limit and
offset should be handled before the points go to the auxiliary iterator
to be split into different iterators. Limiting happened afterwards which
caused the auxiliary iterator to hang forever.
2017-04-28 15:55:06 -05:00
Jonathan A. Sternberg be3bce5212 top() and bottom() now returns the time for every point
`top()` and `bottom()` will now organize the points by time and also
keep the points original time even when a time grouping is used. At the
same time, `top()` and `bottom()` will no longer honor any fill options
that are present since they don't really make sense for these specific
functions.

This also fixes the aggregate and selectors to honor the ordered
iterator option so iterator remain ordered and to also respect the
buckets that are created by the final dimensions of the query so that
two buckets don't overlap each other within the same reducer. A test has
been added for this situation. This should clarify and encourage the use
of the ordered attribute within the query engine.
2017-04-26 15:07:10 -05:00
Jonathan A. Sternberg 4776b216a4 Merge pull request #8253 from influxdata/js-8065-restrict-top-bottom-query
Restrict top() and bottom() selectors to be used with no other functions
2017-04-26 15:06:30 -05:00
Jonathan A. Sternberg 1300f4cc6c Remove the admin UI 2017-04-25 16:58:24 -05:00