Commit Graph

11637 Commits (920c8396c626b87a58d4ac0941da320fa13e0371)

Author SHA1 Message Date
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
joelegasse dcb379779a Merge pull request #7829 from influxdata/jl-deletepath
Add some checks before removing directories
2017-01-12 17:47:10 -05:00
Joe LeGasse 2db0250b22 Add db/rp name validation
This change adds some very basic name validation with the following
plain-english description: names must be non-zero sequence of printable
characters that do not contain slashes ('/' or '\') and are not equal to
either "." or "..".

The intent is that, since we currently just use database and retention
policy names directly as path elements, these rules will hopefully leave
us with names that should be at least close to valid directory names.

Ideally, we would restrict names even further or not use them as path
elements directly, but this should be a step towards the former without
restricting names "too much"
2017-01-12 17:38:10 -05: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
joelegasse 959a36f027 Merge pull request #7831 from influxdata/jl-readdir
Update backup to use ioutil.ReadDir
2017-01-12 16:44:58 -05:00
Joe LeGasse bf58d9ffb7 Update backup to use ioutil.ReadDir 2017-01-12 16:28:01 -05:00
Jason Wilder 22c6eccee9 Merge pull request #7824 from influxdata/ga-cli-message
Remove token message; Fixes #7823
2017-01-12 12:35:24 -07:00
Jason Wilder ccdb68841b Merge pull request #7820 from influxdata/cjl-7689-sgi-unix-epoch-zero-time
fix marshaling of zero time
2017-01-12 12:34:48 -07:00
Jason Wilder 7e7f0d0de2 Merge pull request #7830 from influxdata/jw-cache-snapshot
Cache snapshotting performance improvements
2017-01-12 12:11:53 -07:00
Jason Wilder 11f264563a Fix 32bit alignment 2017-01-12 12:01:49 -07:00
Jason Wilder 06a8fd6ca2 Simplifications and cleanup 2017-01-12 09:55:38 -07:00
Edd Robinson 73ed864e1d Add cache tests 2017-01-12 16:27:16 +00:00
Jason Wilder 33be1e1952 Update changelog 2017-01-12 09:02:59 -07:00
Jason Wilder 1e56b5416b Fix compactions sometimes getting stuck
I ran into an issue where the cache snapshotting seemed to stop
completely causing the cache to fill up and never recover.  I believe
this is due to the the Timer being reused incorrectly.  Instead,
use a Ticker that will fire more regularly and not require the resetting
logic (which was wrong).
2017-01-11 17:57:40 -07:00
Jason Wilder 40b017f4a4 Fix Cache stats size collection
The memory stats as well as the size of the cache were not accurate.
There was also a problem where the cache size would be increased
optimisitically, but if the cache size limit was hit, it would not
be decreased.  This would cause the cache size to grow without
bounds with every failed write.
2017-01-11 17:54:51 -07:00