Commit Graph

11451 Commits (a801c9dea69789709d1661aef58ceb976383da6f)

Author SHA1 Message Date
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
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
Jason Wilder f126929c3d Merge pull request #7872 from influxdata/jw-merge-12
Merge 1.2 branch to master
2017-01-24 08:50:56 -07:00
Jason Wilder c51d0b9a03 Merge branch '1.2' into jw-merge-12 2017-01-24 08:24:56 -07:00
Edd Robinson e45c527bb4 Merge pull request #7864 from manorie/patch-1
Updating Readme to make writePoints function work
2017-01-24 12:26:01 +00:00
Jason Wilder b7bb7e8359 Update 1.2.0 release date 2017-01-23 20:01:48 -07:00
Mehmet Cetin 2079eae951 fixes rand.Seed placement 2017-01-24 00:57:03 +03:00
Jonathan A. Sternberg 17b3a759c0 Merge pull request #7870 from influxdata/js-1.2-subquery-fix-backports
Backport #7841 and #7846 to 1.2
2017-01-23 15:14:34 -06:00
Jonathan A. Sternberg 83c6d53294 Support the WHERE clause in outer queries with subqueries 2017-01-23 15:01:32 -06:00
Jonathan A. Sternberg 3d4d9062a0 Update subqueries so groupings are propagated to inner queries
Previously, only time expressions got propagated inwards. The reason for
this was simple. If the outer query was going to filter to a specific
time range, then it would be unnecessary for the inner query to output
points within that time frame. It started as an optimization, but became
a feature because there was no reason to have the user repeat the same
time clause for the inner query as the outer query. So we allowed an
aggregate query with an interval to pass validation in the subquery if
the outer query had a time range. But `GROUP BY` clauses were not
propagated because that same logic didn't apply to them. It's not an
optimization there. So while grouping by a tag in the outer query
without grouping by it in the inner query was useless, there wasn't any
particular reason to care.

Then a bug was found where wildcards would propagate the dimensions
correctly, but the outer query containing a group by with the inner
query omitting it wouldn't correctly filter out the outer group by. We
could fix that filtering, but on further review, I had been seeing
people make that same mistake a lot. People seem to just believe that
the grouping should be propagated inwards. Instead of trying to fight
what the user wanted and explicitly erase groupings that weren't
propagated manually, we might as well just propagate them for the user
to make their lives easier. There is no useful situation where you would
want to group into buckets that can't physically exist so we might as
well do _something_ useful.

This will also now propagate time intervals to inner queries since the
same applies there. But, while the interval propagates, the following
query will not pass validation since it is still not possible to use a
grouping interval with a raw query (even if the inner query is an
aggregate):

    SELECT * FROM (SELECT mean(value) FROM cpu) WHERE time > now() - 5m GROUP BY time(1m)

This also means wildcards will behave a bit differently. They will
retrieve dimensions from the sources in the inner query rather than just
using the dimensions in the group by.

Fixing top() and bottom() to return the correct auxiliary fields.
Unfortunately, we were not copying the buffer with the auxiliary fields
so those values would be overwritten by a later point.
2017-01-23 15:01:19 -06:00
Jonathan A. Sternberg f3597f7682 Merge pull request #7861 from influxdata/js-7841-where-in-outer-query
Support the WHERE clause in outer queries with subqueries
2017-01-23 14:59:39 -06:00
Jonathan A. Sternberg 6cd5b690d1 Support the WHERE clause in outer queries with subqueries 2017-01-23 14:49:04 -06:00
Jonathan A. Sternberg f199c50d25 Merge pull request #7854 from influxdata/js-7846-subquery-tag-propagation
Update subqueries so groupings are propagated to inner queries
2017-01-23 14:47:18 -06:00
Edd Robinson a67b5457f5 Merge pull request #7869 from influxdata/er-rp-validate-1.2
[Backport 1.2] #7866
2017-01-23 19:36:12 +00:00
Edd Robinson 89ccc852b6 Merge pull request #7868 from influxdata/er-rp-1.2
[Backport 1.2] Fixes #7860.
2017-01-23 19:19:40 +00:00
Edd Robinson d30819b978 Ensure rp names validated in CREATE DATABASE WITH 2017-01-23 19:18:07 +00:00
Edd Robinson ddd2766eac Merge pull request #7866 from influxdata/er-rp-validate
Validate retention policy names
2017-01-23 19:10:34 +00:00
Jason Wilder 3cdb3fe23c Merge pull request #7867 from influxdata/jw-backport-7836
backport: allow partial writes on field conflicts
2017-01-23 12:07:03 -07:00
Edd Robinson 63562d9fd5 Fixes #7860.
Fix a regression introduced in #7449.

This commit ensures that create database with retention policy will work
correctly.
2017-01-23 19:01:13 +00:00
Edd Robinson 0804cdb7b5 Ensure rp names validated in CREATE DATABASE WITH 2017-01-23 19:00:19 +00:00
Edd Robinson e6579cea3b Merge pull request #7865 from influxdata/er-rp
Fix regression in CREATE DATABASE WITH RETENTION POLICY
2017-01-23 18:59:31 +00:00
Cory LaNou d54a955068 allow partial writes on field conflicts 2017-01-23 11:54:46 -07:00
Cory LaNou 11a4cffc10 Merge pull request #7836 from influxdata/cjl-7814-partial-write-on-field-type-conflict
allow partial writes on field conflicts
2017-01-23 12:39:19 -06:00
Jonathan A. Sternberg f628b4a198 Update subqueries so groupings are propagated to inner queries
Previously, only time expressions got propagated inwards. The reason for
this was simple. If the outer query was going to filter to a specific
time range, then it would be unnecessary for the inner query to output
points within that time frame. It started as an optimization, but became
a feature because there was no reason to have the user repeat the same
time clause for the inner query as the outer query. So we allowed an
aggregate query with an interval to pass validation in the subquery if
the outer query had a time range. But `GROUP BY` clauses were not
propagated because that same logic didn't apply to them. It's not an
optimization there. So while grouping by a tag in the outer query
without grouping by it in the inner query was useless, there wasn't any
particular reason to care.

Then a bug was found where wildcards would propagate the dimensions
correctly, but the outer query containing a group by with the inner
query omitting it wouldn't correctly filter out the outer group by. We
could fix that filtering, but on further review, I had been seeing
people make that same mistake a lot. People seem to just believe that
the grouping should be propagated inwards. Instead of trying to fight
what the user wanted and explicitly erase groupings that weren't
propagated manually, we might as well just propagate them for the user
to make their lives easier. There is no useful situation where you would
want to group into buckets that can't physically exist so we might as
well do _something_ useful.

This will also now propagate time intervals to inner queries since the
same applies there. But, while the interval propagates, the following
query will not pass validation since it is still not possible to use a
grouping interval with a raw query (even if the inner query is an
aggregate):

    SELECT * FROM (SELECT mean(value) FROM cpu) WHERE time > now() - 5m GROUP BY time(1m)

This also means wildcards will behave a bit differently. They will
retrieve dimensions from the sources in the inner query rather than just
using the dimensions in the group by.

Fixing top() and bottom() to return the correct auxiliary fields.
Unfortunately, we were not copying the buffer with the auxiliary fields
so those values would be overwritten by a later point.
2017-01-23 12:38:10 -06:00
Cory LaNou 0103e44896
allow partial writes on field conflicts 2017-01-23 12:25:35 -06:00
Edd Robinson 4442cd7efa Fixes #7860.
Fix a regression introduced in #7449.

This commit ensures that create database with retention policy will work
correctly.
2017-01-23 17:57:32 +00:00
Mehmet Cetin 9def65af1b changes log.Fatalln to log.Fatal move random seed inside for loop to make it random 2017-01-23 19:13:05 +03:00
M. Cetin 4d4207be7f Updating Readme to make writePoints function work
Hello,

I have tried this example as it is for now. Encountered an error that AddPoint function expects only one argument. Checked you GoDoc and updated the example in your error handling style. It works like this.
2017-01-23 17:09:01 +03:00
Gunnar 3722fa383d Merge pull request #7718 from influxdata/ga-drop-stats
Add stats on dropped measurements and series; Fixes #7697
2017-01-20 15:54:06 -08:00
Mark Rushakoff 8e0bf700f8 Merge pull request #7857 from twiden/remove-deprecated-readme-instruction
Deprecated use of CREATE DATABASE in a read only context, use a POST …
2017-01-18 19:28:24 -08:00
Tobias Widén cd05decc6b Deprecated use of CREATE DATABASE in a read only context, use a POST request instead 2017-01-18 19:26:28 +01:00
Edd Robinson 5a8e3ee6d6 Merge pull request #7851 from influxdata/er-double-rlock-1.2
[1.2] Backport #7847
2017-01-17 10:54:39 -08:00
Edd Robinson feb7a2842c Use unbuffered error channels in tests 2017-01-17 10:53:15 -08:00
Edd Robinson fb7388cdfc Remove dead code from various pkgs 2017-01-17 09:47:34 -08:00
Edd Robinson 7374e48999 Remove dead code from influxql 2017-01-17 09:47:34 -08:00
Edd Robinson 9d30ee0a6b Fix subtle bugs and remove dead code from services 2017-01-17 09:47:34 -08:00
Edd Robinson 292b30b82b Fix subtle bugs and remove dead code from tsdb 2017-01-17 09:47:34 -08:00
Edd Robinson 320c5981cb Fixes racy locking on measurement 2017-01-17 09:44:56 -08:00
Edd Robinson 0977272c53 Merge pull request #7847 from influxdata/er-double-rlock
Fixes racy locking on measurement
2017-01-17 09:42:17 -08:00
Edd Robinson 45324b3848 Fixes racy locking on measurement 2017-01-16 14:22:11 -08:00
Edd Robinson c46212d7a2 Merge pull request #7840 from influxdata/er-subscriber-1.2
[1.2] Backport #7839
2017-01-14 20:06:58 +00:00
Edd Robinson c47be5bb56 Ensure subscriber service respects config 2017-01-13 22:15:01 +00:00
Edd Robinson bb029b5444 Merge pull request #7839 from influxdata/er-subscriber
Ensure subscriber service respects config
2017-01-13 22:13:15 +00:00
Edd Robinson aa6b85a2dc Ensure subscriber service respects config 2017-01-13 20:09:40 +00:00
Mark Rushakoff 63e5bae7b8 Merge pull request #7832 from influxdata/mr-fix-http-write-memory-leak
Fix memory leak of retained HTTP write payloads
2017-01-13 12:04:24 -08:00
Joe LeGasse cd00085e9e Adjust Tags cloning
This change delays Tag cloning until a new series is found, and will
only clone Tags acquired from `ParsePoints...` and not those referencing
the mmap-ed files (TSM) that are created on startup.
2017-01-13 13:15:36 -05:00
Mark Rushakoff 7964a87310 Update CHANGELOG.md 2017-01-12 16:31:56 -08:00
Mark Rushakoff cdbdd156f3 Fix memory leak of retained HTTP write payloads
This leak seems to have been introduced in 8aa224b22d,
present in 1.1.0 and 1.1.1.

When points were parsed from HTTP payloads, their tags and fields
referred to subslices of the request body; if any tag set introduced a
new series, then those tags then were stored in the in-memory series
index objects, preventing the HTTP body from being garbage collected. If
there were no new series in the payload, then the request body would be
garbage collected as usual.

Now, we clone the tags before we store them in the index. This is an
imperfect fix because the Point still holds references to the original
tags, and the Point's field iterator also refers to the payload buffer.
However, the current write code path does not retain references to the
Point or its fields; and this change will likely be obsoleted when TSI
is introduced.

This change likely fixes #7827, #7810, #7778, and perhaps others.
2017-01-12 16:16:54 -08:00