Commit Graph

12021 Commits (57eeae03fc5419c1249a4a4b890f2e9c9cb9a501)

Author SHA1 Message Date
Jonathan A. Sternberg a0d8c1ca9f Add modulo operator to the query language 2017-02-10 10:16:37 -06:00
Edd Robinson c94858e53b Merge pull request #7982 from influxdata/er-meta-load
Don't load meta data when using TSI
2017-02-10 15:15:54 +00: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
Edd Robinson 38eb6d5994 Don't load meta data for tsi 2017-02-09 18:04:23 +00:00
Edd Robinson a6a2f9d5f0 Don't load meta data for tsi 2017-02-09 17:59:14 +00:00
Jason Wilder 2f74e3f3d5 Use simple8b.CountBytes to avoid allocations 2017-02-09 10:47:03 -07:00
Edd Robinson 1aebb6d58e Merge pull request #7976 from influxdata/er-tsi
Reduce allocations
2017-02-09 16:42:22 +00: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
Edd Robinson 2d59fb788c Modify arguments to reduce allocations 2017-02-09 15:01:32 +00:00
Edd Robinson c2bbc18e4b Reduce repeated string allocations 2017-02-09 11:23:23 +00: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
Edd Robinson 21e821e5f9 Reduce memory footprint by pre-allocating 2017-02-08 18:49:03 +00:00
Edd Robinson 4fbba8234e Add Size to models.Tags 2017-02-08 18:44:48 +00: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
Edd Robinson a9d58cc879 Add log file benchmarks 2017-02-08 16:50:46 +00:00
Ben Johnson d6fedcacd5
Refactor tsi.LogFile compaction. 2017-02-08 09:00:08 -07: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
Ben Johnson c4e9430de3
Recover after partial tsi log file write. 2017-02-07 10:02:31 -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
Ben Johnson d91e6eabac
Add max-values-per-tag to inmem index. 2017-02-06 11:14:13 -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
Edd Robinson 54193e1131 Ensure config contains valid index 2017-02-03 11:57:41 +00:00
Edd Robinson 908959a78a Fix vet 2017-02-03 11:57:35 +00: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
Ben Johnson 76235f1e00
Use original index type for existing shards. 2017-02-02 10:43:48 -07:00
Ben Johnson c246f3d9b0
Use inmem index on existing shards. 2017-02-02 10:04:25 -07: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
Edd Robinson 5a37d51f02 Refactor DropSeries 2017-02-01 22:07:44 +00:00
Ben Johnson 57f44d5f0c
Include index in snapshot. 2017-02-01 14:19:42 -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