Commit Graph

11602 Commits (e1cc01e0a324bd8cbc36f328282b091666a8106b)

Author SHA1 Message Date
Jonathan A. Sternberg 83cf8893e1 Include IsRawQuery in the rewritten statement for meta queries 2017-03-06 14:46:33 -06:00
Jason Wilder 675d7c9d65 Merge branch '1.2' into jw-merge12 2017-03-06 11:09:05 -07:00
Jason Wilder 58dd3dbefb Merge pull request #8094 from influxdata/jw-8084
Fix points missing after compaction
2017-03-06 10:27:20 -07:00
Jason Wilder eab012ef61 Fix points missing after compaction
If blocks containing overlapping ranges of time where partially
recombined, it was possible for the some points to get dropped
during compactions.  This occurred because the window of time of
the points we need to merge did not account for the partial blocks
created from a prior merge.

Fixes #8084
2017-03-06 10:17:11 -07:00
Jason Wilder 80f9a29d7f Merge pull request #8095 from influxdata/jw-cache-race2
Fix race in WALEntry.Encode and Values.Deduplicate
2017-03-06 10:12:43 -07:00
Jason Wilder 3c70abf061 Delete series before remove from field index
There is a race where the field type can be deleted while a new type
is written and during a query.  When this happens, an iterator for
the new type is created but old data make still exist in the cache
for TSM files causing a panic.
2017-03-06 09:38:27 -07:00
Jason Wilder 29f8d8de76 Fix race in WALEntry.Encode and Value.Deduplicate
Under high query load, a race exists in the cache and the WAL.  Since
writes currently hit the cache first, they are availble for query before
they hit the WAL.  If the WAL is writing and accessign the Value slice
at the same time that a query is run that needs to dedup the same slice,
a race occurs.

To fix this, the cache now just copies the values instead of storing the
slice passed in.  Another way to fix this might be to have the writes go
to the wal before the cache.  I think the latter would be better, but it
introduces some larger write path issues that we'd need to also address.
e.g. if the cache was full, writes to the WAL would need to be rejected
to avoid filling the disk.

Copying the slice in the cache is simpler for now and does not appear to
dramatically affect performance.
2017-03-06 09:38:22 -07:00
Ben Johnson f632770cda Merge pull request #8092 from benbjohnson/field-type-conflict-write-check
Re-check field type under write lock.
2017-03-03 14:18:06 -07:00
Ben Johnson 4c202eea09
Re-check field type under write lock. 2017-03-03 09:47:43 -07:00
Ben Johnson fab0b86dc3 Merge pull request #8080 from benbjohnson/point-bounds-check-1.2
Point.UnmarshalBinary() bounds check
2017-03-01 12:03:48 -07:00
Ben Johnson dffd12319c
Add point.UnmarshalBinary() bounds checking. 2017-03-01 12:01:25 -07:00
Jonathan A. Sternberg bf84b91535 Merge pull request #8079 from influxdata/js-8078-map-type-field-with-multiple-measurements
Map types correctly when selecting a field with multiple measurements where one of the measurements is empty
2017-03-01 12:23:04 -06:00
Jonathan A. Sternberg c5970b59b4 Map types correctly when selecting a field with multiple measurements where one of the measurements is empty 2017-03-01 11:47:26 -06:00
Jonathan A. Sternberg b942f3a373 Merge pull request #8069 from influxdata/js-8044-measurement-with-underscore-prefix
Treat non-reserved measurement names with underscores as normal measurements
2017-02-28 10:21:26 -06:00
Jason Wilder 50c2144170 Merge pull request #8070 from influxdata/jw-merge-11
Merge 1.1.4 changelog
2017-02-27 17:42:39 -07:00
Jason Wilder 414fe1349e Merge 1.1.4 changelog 2017-02-27 16:51:07 -07:00
Jonathan A. Sternberg 1081785cb4 Treat non-reserved measurement names with underscores as normal measurements
A measurement name that begins with an underscore and does not conflict
with one of the reserved measurement names will now be passed untouched
to the underlying shards rather than being intercepted as an empty
measurement.

A user still shouldn't rely on measurements that begin with underscores
to always be accessible, but this will prevent the most common use case
from causing unexpected behavior since we will very rarely, if ever, add
additional system sources.
2017-02-27 16:49:02 -06:00
Jonathan A. Sternberg f62a49c160 Merge pull request #8056 from influxdata/js-7880-dividing-aggregate-with-elapsed
Dividing aggregate functions with different outputs doesn't panic
2017-02-24 11:50:46 -06:00
Jonathan A. Sternberg 1fb34e3eef Dividing aggregate functions with different outputs doesn't panic 2017-02-23 18:38:29 -06:00
David Norton 8c59595b89 Merge pull request #8055 from influxdata/dgn-fix-collectd-panic-2
fix #8028: call api.NewTypesDB() instead of new
2017-02-23 18:12:43 -05:00
David Norton c7fa58473f fix #8028: call api.NewTypesDB() instead of new
The code was calling new(api.TypesDB) which didn't initialize an
unexported map inside of the type. Call api.NewTypesDB() instead.
2017-02-23 18:04:21 -05:00
Jonathan A. Sternberg a20c2dc232 Merge pull request #8051 from influxdata/js-7968-panic-when-selecting-tag-from-inner-query
Allow selecting tag within subquery
2017-02-23 11:39:50 -06:00
Jonathan A. Sternberg 72e4dd01b9 Properly select a tag within a subquery
Previously, subqueries would only be able to select tag fields within a
subquery if the subquery used a selector. But, it didn't filter out
aggregates like `mean()` so it would panic instead.

Now it is possible to select the tag directly instead of rewriting the
query in an invalid way.

Some queries in this form will still not work though. For example, the
following still does not function (but also doesn't panic):

    SELECT count(host) FROM (SELECT mean, host FROM (SELECT mean(value) FROM cpu GROUP BY host))
2017-02-23 11:16:22 -06:00
Jonathan A. Sternberg 05fcf04236 Merge pull request #8052 from influxdata/js-8040-paren-expr-subquery-panic
Reduce the expression in a subquery to avoid a panic
2017-02-23 11:15:56 -06:00
Jonathan A. Sternberg 5a2b458180 Reduce the expression in a subquery to avoid a panic
The builder used for subqueries does not handle parenthesis, but a set
of parenthesis wrapping a field would cause it to panic. This code now
reduces the expression so the parenthesis are removed before being
processed.
2017-02-23 10:14:05 -06:00
Jason Wilder c83c742b49 Merge pull request #8047 from influxdata/jw-merge-12
Merge 1.2 to master
2017-02-22 12:38:23 -07:00
Jason Wilder a024003f2c Merge branch '1.2' into jw-merge-12 2017-02-22 12:13:29 -07:00
Jason Wilder 5c1d97e4a0 Merge pull request #8038 from influxdata/jw-merge-11
Remove Tags.shouldCopy, replace with forceCopy on series creation.
2017-02-21 11:46:58 -07:00
Ben Johnson 78a9bb2527 Remove Tags.shouldCopy, replace with forceCopy on series creation.
Previously, tags had a `shouldCopy` flag to indicate if those tags
referenced an underlying buffer and should be copied to allow GC.
Unfortunately, this prevented tags from being copied that were
created and referenced the mmap which caused segfaults.

This change removes the `shouldCopy` flag and replaces it with a
`forceCopy` argument in `CreateSeriesIfNotExists()`. This allows
the write path to indicate that tags must be cloned on insert.
2017-02-21 11:13:35 -07:00
Jason Wilder f67b8afb6f Merge pull request #8030 from influxdata/mr-merge-12
Merge 1.2 branch
2017-02-17 17:55:15 -07:00
Mark Rushakoff 601cbcd084 Merge branch '1.2' into mr-merge-12 2017-02-17 16:14:22 -08:00
Jonathan A. Sternberg 7c23d6869c Merge pull request #8029 from influxdata/js-rename-zap-import
Rename zap import back to github.com/uber-go/zap
2017-02-17 17:28:06 -06:00
Jonathan A. Sternberg 2fe48d6781 Rename zap import back to github.com/uber-go/zap
They rebased a revision we were previously relying upon that allowed us
to use the vanity name so we are reverting back to an older version with
the old import path.
2017-02-17 17:17:22 -06:00
Ben Johnson bae0987711 Merge pull request #8011 from benbjohnson/fix-series-tags-map
Fix tag dereferencing panic.
2017-02-15 18:25:02 -07:00
Ben Johnson 8e79ca5d75
Fix tag dereferencing panic.
Clones series tags under lock during var ref iterator creation.
2017-02-15 17:56:47 -07:00
Jason Wilder 8b9c6b8a98 Merge pull request #8008 from influxdata/jw-int-tests
Make integration tests runnable against remote servers
2017-02-15 11:15:26 -07:00
Jason Wilder 524169b814 Move integration tests to tests dir 2017-02-15 10:37:29 -07:00
Jason Wilder 4c3f605256 Remote everything in tests dir
Lots of old cruft.  Integeration tests will be moved here shortly.
2017-02-15 10:13:49 -07:00
Jason Wilder 517df0f939 Make integration tests able to run against remote server
URL=http://localhost:8086 go test -parallel 1 ./cmd/influxd/run

will run the tests over HTTP against localhost:8086.  They currently
need to be run serially since they all write to the same DB.
2017-02-15 10:07:40 -07:00
Jonathan A. Sternberg 0e0057d1da Merge pull request #8002 from influxdata/js-8001-map-types-with-empty-measurement
Map types correctly when using a regex and one of the measurements is empty
2017-02-13 18:24:30 -06:00
Jonathan A. Sternberg 71f62d33e6 Map types correctly when using a regex and one of the measurements is empty 2017-02-13 18:14:29 -06:00
Mark Rushakoff c762ab49ee Merge pull request #7974 from influxdata/mr-4785-show-databases
Allow non-admin users to execute SHOW DATABASES
2017-02-13 15:04:00 -08:00
Jason Wilder f45a58937c Merge pull request #7998 from influxdata/jw-merge-12
Merge 1.2.1-rc3 to master
2017-02-13 14:24:17 -07:00
Jonathan A. Sternberg 9636960ce6 Merge pull request #7990 from influxdata/js-modulo-operator-fix
Fixed String() output for MOD operator and added MOD op precedence
2017-02-13 14:46:12 -06:00
Jason Wilder c3de210ded Merge branch '1.2' into jw-merge-12 2017-02-13 11:45:27 -07:00
Mark Rushakoff 53699aa24f Allow non-admin users to execute SHOW DATABASES
This commit introduces a new interface type, influxql.Authorizer, that
is passed as part of a statement's execution context and determines
whether the context is permitted to access a given database. In the
future, the Authorizer interface may be expanded to other resources
besides databases. In this commit, the Authorizer interface is
specifically used to determine which databases are returned when
executing SHOW DATABASES.

When HTTP authentication is enabled, the existing meta.UserInfo struct
implements Authorizer, meaning admin users can SHOW every database, and
non-admin users can SHOW only databases for which they have read and/or
write permission.

When HTTP authentication is disabled, all databases are visible through
SHOW DATABASES.

This addresses a long-standing issue where Chronograf or Grafana would
be unable to list databases if the logged-in user did not have admin
privileges.

Fixes #4785.
2017-02-13 08:59:16 -08:00
Jonathan A. Sternberg 19f331a450 Merge pull request #7989 from jgeiger/master
Add chunked processing back into v2 client
2017-02-13 10:54:08 -06:00
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 55e64e1edd Fixed String() output for MOD operator and added MOD op precedence 2017-02-10 16:48:05 -06:00
Jason Wilder 8d0f2c3ca9 Merge pull request #7983 from influxdata/jw-parallel-buffers
Increase parallel iterator buffers to improve group by query speed
2017-02-10 11:22:59 -07:00