Commit Graph

11602 Commits (e1cc01e0a324bd8cbc36f328282b091666a8106b)

Author SHA1 Message Date
Jason Wilder 5e42ac411a Increase buffer to improve group by query speed 2017-02-10 11:07:49 -07:00
Jonathan A. Sternberg 5395bd3bcf Merge pull request #7765 from influxdata/js-7553-modulo-operator
Add modulo operator to the query language
2017-02-10 11:46:24 -06:00
Jason Wilder 4b6289ce58 Merge pull request #7942 from influxdata/jw-cache-partitions
Reduce write timeouts
2017-02-10 10:07:08 -07:00
Jonathan A. Sternberg a0d8c1ca9f Add modulo operator to the query language 2017-02-10 10:16:37 -06:00
Jason Wilder c88b1c3a96 Merge pull request #7981 from influxdata/jw-simple8b-update
Use simple8b.CountBytes to avoid allocations
2017-02-09 11:05:08 -07:00
Jason Wilder 2f74e3f3d5 Use simple8b.CountBytes to avoid allocations 2017-02-09 10:47:03 -07:00
Jason Wilder 0d9fd8a37b Merge pull request #7948 from CAFxX/gzip_encoder_pool
[influxd] Use sync.Pool to reuse gzip.Writers across requests
2017-02-09 09:04:24 -07:00
Carlo Alberto Ferraris 005e480b55 [influxd] add utility functions to make it harder to misuse gzipWriterPool 2017-02-09 09:31:11 +09:00
Jonathan A. Sternberg afbfa0086f Merge pull request #7966 from influxdata/js-7898-prevent-panic-when-aggregate-returns-no-aux-fields
Prevent a panic when aggregates are used in an inner query with a raw query
2017-02-08 12:49:14 -06:00
Jonathan A. Sternberg 2ad1668c2a Prevent a panic when aggregates are used in an inner query with a raw query
The following types of queries will panic:

    SELECT mean, host FROM (SELECT mean(value) FROM cpu GROUP BY host)
    SELECT top(sum, host, 3) FROM (SELECT sum(value) FROM cpu GROUP BY host)

These queries _should_ work, but due to a current limitation with
aggregate functions, the aggregate functions won't return any auxiliary
fields. So even if a tag is not an auxiliary field, it is treated that
way by the query engine and this query will fail.

Fixing this properly will take a longer period of time. This fix just
prevents the panic from killing the server while we fix this for real.
2017-02-08 11:44:56 -06:00
Jason Wilder 8c25f0104e Merge pull request #7958 from influxdata/jw-merge-12
Merge 1.2.1-rc2 to master
2017-02-07 13:29:00 -07:00
Jason Wilder 1bc0f68490 Merge branch '1.2' into jw-merge-12 2017-02-07 12:48:36 -07:00
Jonathan A. Sternberg b3930f2a3f Merge pull request #7907 from influxdata/js-7905-order-by-desc-fix
Fix ORDER BY time DESC with ordering series keys
2017-02-06 15:57:35 -06:00
Jonathan A. Sternberg e1fa48d0dd Fix ORDER BY time DESC with ordering series keys
The order of series keys is in ascending alphabetical order, not
descending alphabetical order, when it is ordered by descending time.
This fixes the ordering so points are returned in descending order. The
emitter also had the conditions for choosing which iterator to use in
the wrong direction (which only affects aggregates with `FILL(none)`).
2017-02-06 15:49:12 -06:00
Jonathan A. Sternberg 11a49db662 Merge pull request #7954 from influxdata/js-7885-fix-limit-and-offset-in-subqueries
Fix LIMIT and OFFSET when they are used in a subquery
2017-02-06 15:46:49 -06:00
Carlo Alberto Ferraris a6a7782e04 [influxd] Use a sync.Pool to reuse gzip.Writer across requests
This brings alloc_space down from ~20200M to ~10700M in a run of
go test ./cmd/influxd/run -bench=Server -memprofile=mem.out -run='^$'
2017-02-07 05:23:58 +09:00
Jonathan A. Sternberg 95831b3307 Fix LIMIT and OFFSET when they are used in a subquery
This fixes LIMIT and OFFSET when they are used in a subquery where the
grouping of the inner query is different than the grouping of the outer
query. When organizing tag sets, the grouping of the outer query is
used so the final result is in the correct order. But, unfortunately,
the optimization incorrectly limited the number of points based on the
grouping in the outer query rather than the grouping in the inner query.

The ideal solution would be to use the outer grouping to further
organize it by the grouping for the inner subquery, but that's more
difficult to do at the moment. As an easier fix, the query engine now
limits the output of each series. This may result in these types of
queries being slower in some situations like this one:

    SELECT mean(value) FROM (SELECT value FROM cpu GROUP BY host LIMIT 1)

This will be slower in a situation where the `cpu` measurement has a
high cardinality and many different tags.

This also fixes `last()` and `first()` when they are used in a subquery
because those functions use `LIMIT 1` as an internal optimization.
2017-02-06 14:04:34 -06:00
Jonathan A. Sternberg 4d97dd495d Merge pull request #7952 from influxdata/js-7946-subquery-authorization
Fix authentication when subqueries are present
2017-02-06 14:03:50 -06:00
Jason Wilder 93a9d01643 Increase default waiting WAL writes 2017-02-06 11:48:51 -07:00
Jason Wilder 38a649fc40 Batch multiple WAL fsyncs
Every write to the WAL current runs and fsync before returning.  When
there are lot of concurrent writes, this can cause the WAL to bottleneck
write throughput since fsyncs are very expensive.

This changes the writeToLog to fsync on an interval to allow multiple fsyncs
calls to be batched up into one.  The writeToLog behavior is the same in that
it won't return until an fsync has been performed.
2017-02-06 11:48:45 -07:00
Jonathan A. Sternberg caaad60dcf Fix authentication when subqueries are present
The code that checked if a query was authorized did not account for
sources that were subqueries. Now, the check for the required privileges
will descend into the subquery and add the subqueries required
privileges to the list of required privileges for the entire query.
2017-02-06 09:43:14 -06:00
Jason Wilder 98e19f257c Merge pull request #7938 from influxdata/jw-merge-12
Merge 1.2.1-rc1 to master
2017-02-03 09:57:44 -07:00
Jason Wilder 2e95b4043c Merge branch '1.2' into jw-merge-12 2017-02-02 16:40:36 -07:00
Jonathan A. Sternberg d5ac69be6f Merge pull request #7937 from influxdata/js-7895-incorrect-calculations-math-with-aggregates
Fix incorrect math when aggregates that emit different times are used
2017-02-02 16:02:27 -06:00
Jonathan A. Sternberg e49ba016fa Fix incorrect math when aggregates that emit different times are used
When using `non_negative_derivative()` and `last()` in a math aggregate
with each other, the math would not be matched with each other because
one of those aggregates would emit one fewer point than the others. The
math iterators have been modified so they now track the name and tags of
a point and match based on those.

This isn't necessarily ideal and may come to bite us in the future. We
don't necessarily have a defined structure for all iterators so it can
be difficult to know which of two points is supposed to come first in
the ordering. This uses the common ordering that usually makes sense,
but the query engine is getting complicated enough where I am not 100%
certain that this is correct in all circumstances.
2017-02-02 14:40:41 -06:00
joelegasse f9a043d859 Merge pull request #7935 from influxdata/jl-regex-case-master#7906
Porting #7934 to master
2017-02-02 11:05:04 -05:00
joelegasse b0abd6a23b Merge pull request #7934 from influxdata/jl-regex-case#7906
regex: don't use exact match for case insensitive expression
2017-02-02 10:53:35 -05:00
Joe LeGasse 9abd5ba46f updated CHANGELOG 2017-02-02 10:49:30 -05:00
Joe LeGasse dd9278a098 regex: don't use exact match for case insensitive expression
Fixes #7906

In an attempt to reduce the overhead of using regex for exact matches,
the query parser will replace `=~ /^thing$/` with `== 'thing'`, but the
conditions being checked would ignore if any flags were set on the
expression, so `=~ /(?i)^THING$/` was replaced with `== 'THING'`, which
will fail unless the case was already exact. This change ensures that no
flags have been changed from those defaulted by the parser.
2017-02-02 10:49:12 -05:00
Joe LeGasse 37d4973609 updated CHANGELOG 2017-02-02 10:25:32 -05:00
Joe LeGasse 93d18d42a6 regex: don't use exact match for case insensitive expression
Fixes #7906

In an attempt to reduce the overhead of using regex for exact matches,
the query parser will replace `=~ /^thing$/` with `== 'thing'`, but the
conditions being checked would ignore if any flags were set on the
expression, so `=~ /(?i)^THING$/` was replaced with `== 'THING'`, which
will fail unless the case was already exact. This change ensures that no
flags have been changed from those defaulted by the parser.
2017-02-02 10:25:08 -05:00
Ben Johnson dc36f9f7aa Merge pull request #7929 from benbjohnson/tag-iteration-sigsegv
Fix series tag iteration segmentation fault
2017-02-01 19:02:45 -07:00
Ben Johnson faef0a99c9
Perform series tag iteration under lock.
Adds a `tsdb.Series.ForEachTag()` function for safely iterating
over a series' tags within the context of a lock. This preverts
tags from being dereferenced during iteration which can cause
a seg fault.
2017-02-01 16:25:53 -07:00
Jason Wilder 54ab3a7a0a Don't write lock file store when opening new files
When replacing TSM files, the new files can be opened before
the write lock is taken to reduce lock contention in this code
path.
2017-02-01 11:11:26 -07:00
Jason Wilder 6eb46d2100 Remove unnecessary read lock on engine 2017-02-01 11:10:41 -07:00
Cory LaNou 8e14f0173b Merge pull request #7924 from influxdata/cjl-7880-elapsed-panic
fix panic in query execution
2017-02-01 12:03:39 -06:00
Jonathan A. Sternberg 9b0e696deb Merge pull request #7919 from influxdata/js-7910-backport
Fix EvalType when a parenthesis expression is used
2017-02-01 12:01:15 -06:00
Cory LaNou e3e319a176 fix panic in query execution 2017-02-01 10:51:26 -06:00
Jason Wilder 784a851742 Release cpu during compactions 2017-01-31 17:04:36 -07:00
Jason Wilder 278c1449d6 Increase number of cache partitions 2017-01-31 16:49:57 -07:00
Jonathan A. Sternberg e060fd0aa3 Fix EvalType when a parenthesis expression is used
It did not descend into the expression within the parenthesis correctly
and would just recurse infinitely on itself instead.
2017-01-31 10:35:21 -06:00
Jonathan A. Sternberg 2fe8ed3084 Merge pull request #7916 from influxdata/js-7910-eval-type-with-paren
Fix EvalType when a parenthesis expression is used
2017-01-31 10:34:55 -06:00
Jonathan A. Sternberg e8719c90ab Fix EvalType when a parenthesis expression is used
It did not descend into the expression within the parenthesis correctly
and would just recurse infinitely on itself instead.
2017-01-31 10:19:43 -06:00
Edd Robinson 929b89bc33 Merge pull request #7863 from influxdata/er-uptime
Add system information to /debug/vars
2017-01-30 21:58:44 +00:00
Paul Dix 457dff635f Merge pull request #7904 from influxdata/er-release-notes
Update release notes for 1.2
2017-01-30 13:49:12 -05:00
Edd Robinson c63c4bbc78 Update release notes for 1.2 2017-01-30 18:46:20 +00:00
Edd Robinson 366223140d Add system information to /debug/vars 2017-01-30 18:23:21 +00:00
Paul Dix a801c9dea6 Merge pull request #7889 from influxdata/js-subquery-fixes
Cherry-pick 1.2 fixes for subqueries into master
2017-01-26 10:49:37 -05:00
Edd Robinson 91ee34b111 Merge pull request #7837 from influxdata/er-tidy
General tidy up and subtle bug fixes
2017-01-26 13:43:07 +00:00
Jonathan A. Sternberg ce54856e3d Expand query dimensions from the subquery
During development, I, at some point, decided that the dimensions should
be expanded based on what was available rather than what was present in
the subquery. I don't really know the rationale for this because I
forgot, but it doesn't make sense or seem to be particularly useful.

Expanding dimensions now just uses the values specified in the subquery
rather than expanding to all available dimensions of the measurement in
the subquery.
2017-01-25 16:33:03 -06:00