Commit Graph

1762 Commits (19f331a450d7542a0b471423adac7b949baa9628)

Author SHA1 Message Date
jgeiger 43117a94d6 Add chunked processing back into v2 client
- Moving the to v2 client removed this functionality. This copies
  code back into the client. The tests were also added back into
  the test suite.
2017-02-13 09:21:13 -07:00
Jonathan A. Sternberg a0d8c1ca9f Add modulo operator to the query language 2017-02-10 10:16:37 -06: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
Jason Wilder 1bc0f68490 Merge branch '1.2' into jw-merge-12 2017-02-07 12:48:36 -07: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
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 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 2e95b4043c Merge branch '1.2' into jw-merge-12 2017-02-02 16:40:36 -07: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
Joe LeGasse 9abd5ba46f updated CHANGELOG 2017-02-02 10:49:30 -05:00
Joe LeGasse 37d4973609 updated CHANGELOG 2017-02-02 10:25:32 -05: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
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
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
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
Jonathan A. Sternberg 2980f5b2b4 Fix mapping of types when the measurement uses a regex
With the new shard mapper implementation, regexes were just ignored so
it attempted to look up the field type inside of a measurement with no
name (which cannot possibly exist) so it would think the field didn't
exist and map it as the unknown type.
2017-01-25 16:32:57 -06:00
Jonathan A. Sternberg 92c5d336b4 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:02:37 -06:00
Jonathan A. Sternberg 552408c949 Fix mapping of types when the measurement uses a regex
With the new shard mapper implementation, regexes were just ignored so
it attempted to look up the field type inside of a measurement with no
name (which cannot possibly exist) so it would think the field didn't
exist and map it as the unknown type.
2017-01-25 09:49:51 -06:00
Jason Wilder b7bb7e8359 Update 1.2.0 release date 2017-01-23 20:01:48 -07:00
Cory LaNou d54a955068 allow partial writes on field conflicts 2017-01-23 11:54:46 -07:00
Edd Robinson 320c5981cb Fixes racy locking on measurement 2017-01-17 09:44:56 -08:00
Edd Robinson c47be5bb56 Ensure subscriber service respects config 2017-01-13 22:15:01 +00:00
Mark Rushakoff 7964a87310 Update CHANGELOG.md 2017-01-12 16:31:56 -08:00
Joe LeGasse b19260fb26 Add some checks before removing directories
Fixes #7822

This change first ensures that databases and retention policies exist
before attempting to remove them from the Store. It also adds some
checks in the `DeleteDatabase` and `DeleteRetentionPolicy` to ensure
that maliciously named entries won't remove anything outside of the
configured data directory.
2017-01-12 17:38:10 -05:00
Jason Wilder 33be1e1952 Update changelog 2017-01-12 09:02:59 -07:00
Vladimir Lopes f05df2a263 Fix panic when pruning shard groups
* Fix #7812 - Panic when pruning shard groups

* Update CHANGELOG.md
2017-01-11 14:56:40 +00:00
Jonathan A. Sternberg 73b76d1227 Verbose output for SSL connection errors
When an error that appears to be an SSL error happens without SSL
enabled, the client will attempt to reconnect with SSL just to see if
that works. If it works, it exits with an error message telling the user
to add `-ssl`. It will also do the same if the SSL connection is unsafe
although it will warn that this is insecure.
2017-01-10 11:53:17 -06:00
Jonathan A. Sternberg d7c8c7ca4f Support subquery execution in the query language
This adds query syntax support for subqueries and adds support to the
query engine to execute queries on subqueries.

Subqueries act as a source for another query. It is the equivalent of
writing the results of a query to a temporary database, executing
a query on that temporary database, and then deleting the database
(except this is all performed in-memory).

The syntax is like this:

    SELECT sum(derivative) FROM (SELECT derivative(mean(value)) FROM cpu GROUP BY *)

This will execute derivative and then sum the result of those derivatives.
Another example:

    SELECT max(min) FROM (SELECT min(value) FROM cpu GROUP BY host)

This would let you find the maximum minimum value of each host.

There is complete freedom to mix subqueries with auxiliary fields. The only
caveat is that the following two queries:

    SELECT mean(value) FROM cpu
    SELECT mean(value) FROM (SELECT value FROM cpu)

Have different performance characteristics. The first will calculate
`mean(value)` at the shard level and will be faster, especially when it comes to
clustered setups. The second will process the mean at the top level and will not
include that optimization.
2017-01-07 13:00:48 -06:00
Mark Rushakoff 153277c01d Merge pull request #7786 from influxdata/mr-cache-decrease-size
Use one atomic operation in (*Cache).decreaseSize
2017-01-06 10:17:01 -08:00
Jason Wilder 15915446ff Merge pull request #7323 from miry/env-array-config
Allow add items to array config via ENV
2017-01-04 14:20:03 -07:00
Mark Rushakoff 89a587e865 Use one atomic operation in (*Cache).decreaseSize
The previous implementation was susceptible to a race condition (of
correctness) since c.decreaseSize is called without a lock in
(*Cache).WriteMulti.

There were already tests which asserted the correctness of the result of
decreaseSize, so no tests were added or modified.
2017-01-04 13:13:31 -08:00
Cory LaNou 3c518f8927
panicing is bad -> error returns are good 2017-01-03 14:28:29 -06:00
Mark Rushakoff 959c445a88 Fix broken return statements swallowing errors
There was no comment on either case specifying that the `return nil`
was deliberate instead of `return err`, so I'm assuming these were
typos. I added tests to conserve the error-returning behavior.
2017-01-03 08:50:34 -08:00
Michael Nikitochkin 5ebd4244b1 Merge branch 'master' into env-array-config 2017-01-02 16:35:55 +01:00
Jonathan A. Sternberg 0a04499992 Merge pull request #7688 from harryrose/master
Add bound parameters map to Query object
2016-12-23 17:08:14 -06:00
Michael Nikitochkin 65b08e56f7 [#7323]: Allow add items to array config via ENV
Allow to create a new templates or tags configs, if there are no records
in the default config.

Fixes: #6943
2016-12-23 09:20:46 +01:00
Michael Desa 34bfa52272 Fix changelog typo for fill linear PR
Thanks @inselbuch for noticing the issue
2016-12-22 00:53:10 -05:00
Harry Rose 0cb456bda1 Update CHANGELOG.md 2016-12-20 20:18:43 +00:00
Cory LaNou bc5736f59d Merge pull request #7672 from influxdata/cjl-7563-rp-duration-inf
Enforce minimum shard duration when creating retention policies
2016-12-20 12:16:07 -06:00
Cory LaNou 880c7cdcc8 Merge branch 'master' into cjl-3188-cli-rp-context 2016-12-20 09:55:40 -06:00
Cory LaNou 0cbdea531a add the ability for retention policy context in cli with use command 2016-12-20 09:15:38 -06:00
Cory LaNou fbc9e3cfcc add clear command to cli 2016-12-20 09:14:20 -06:00
Cory LaNou 572da8985c enforce minimum shard duration when creating retention policies 2016-12-20 09:11:43 -06:00
Edd Robinson f55995f9be Merge pull request #7740 from oiooj/pr-fix
fix scan tag value panic
2016-12-20 10:42:42 +00:00
timhallinflux fa80b9c8cf Update CHANGELOG.md
v0.13.0 -- Added PR #6277. 
- [#6277](https://github.com/influxdata/influxdb/pull/6277): Fix deadlock in tsm1/file_store
2016-12-19 20:02:43 -08:00