Commit Graph

556 Commits (efdc6e592bb60a5357d90c045834d8943b4822c9)

Author SHA1 Message Date
Jonathan A. Sternberg 791cf15cd3
build(flux): update Flux to v0.57.0 2019-12-10 13:26:10 -06:00
Gavin Cabbage f1975bb268 refactor(logger): use TraceInfo in TraceFields 2019-12-10 09:06:33 -05:00
Gavin Cabbage b7c2c997d2 feat(query): annotate logger with trace id 2019-12-10 09:06:33 -05:00
Johnny Steenbergen ad841608ca chore(http): refactor bucket|dashboard|label|umr|var http clients to use reusable HTTP client
this is a step towards providing a shared http client that manages  pooling connections,
timeouts, and reducing GC for by not creating/GCing a client each req. Bring on the red!
2019-12-09 09:44:41 -08:00
Lorenzo Affetti f765612ec1 feat(query): add trace_id and sampled to the query log 2019-12-05 16:06:15 +01:00
Jacob Marble 5f19c6cace
chore: Remove several instances of WithLogger (#15996)
* chore: Remove several instances of WithLogger

* chore: unexport Logger fields

* chore: unexport some more Logger fields

* chore: go fmt

chore: fix test

chore: s/logger/log

chore: fix test

chore: revert http.Handler.Handler constructor initialization

* refactor: integrate review feedback, fix all test nop loggers

* refactor: capitalize all log messages

* refactor: rename two logger to log
2019-12-04 15:10:23 -08:00
Nathaniel Cook fd63ff17f3
feat(cmd/influx): add command to manually transpile InfluxQL to Flux (#16119) 2019-12-04 13:31:20 -07:00
Christopher M. Wolff ec288a6434
fix(query): update version of Flux in promqltests (#16091) 2019-12-03 11:07:12 -08:00
Jonathan A. Sternberg d7ddcf5abc
feat(query): enable optimized pivot push down rule (#16073)
Use the optimized pivot when the influxdb source is being used.
2019-12-03 09:16:19 -06:00
Christopher M. Wolff 291f7b3e19
build(flux): update Flux to v0.54.0 (#15851) 2019-11-12 08:38:57 -08:00
Christopher M. Wolff 360a3d9d53
build(query): update promqltests to latest Flux version (#15786) 2019-11-06 12:22:42 -08:00
Christopher Wolff 51c92fd0ed test(query): reskip flakey test
https://github.com/influxdata/influxdb/issues/15667
2019-10-30 14:22:59 -07:00
Christopher Wolff 7aa1fccee0 test(query): unskip skipped PromQL transpiler end-to-end .flux tests 2019-10-30 10:40:03 -07:00
Julius Volz e4558257e3 test(query): add PromQL end-to-end tests in go submodule
Signed-off-by: Lorenzo Affetti <lorenzo.affetti@gmail.com>
Signed-off-by: Julius Volz <julius.volz@gmail.com>

move to internal

update flux to v0.50

Revert "move to internal"

This reverts commit bcd4caffbd44135f1dbeac4163cb2a22a751f45a.

promtests/internal --> internal/promtests
2019-10-28 18:59:50 +01:00
Jonathan A. Sternberg 33c3f92329
fix(query/stdlib): fix rewritten pushable expressions when a logical expression is present (#15557)
When `exists` was used in conjunction with any other pushed down
expression, the `exists` was not rewritten properly because the rewrite
did not descend into logical expressions.

This is now fixed so those expressions will be rewritten correctly. This
affected the following form:

    filter(fn: (r) => r._measurement == "cpu" and exists r.host)

It did not affect the following:

    filter(fn: (r) => r._measurement == "cpu")
    |> filter(fn: (r) => exists r.host)
2019-10-23 15:59:20 -07:00
Jonathan A. Sternberg f82e6b2626
chore(query/stdlib): skip flaky tests regarding storage meta queries (#15451) 2019-10-17 09:54:44 -07:00
Jonathan A. Sternberg 74829b025c
refactor(query/stdlib): update flux end to end tests for package subtests (#15392) 2019-10-15 09:18:21 -05:00
Jonathan A. Sternberg 8ac8ecdb31
feat(query/control): include variable memory limits for the controller (#15300)
The controller now supports setting an initial memory limit and setting
a maximum amount of memory that the controller may use separately from
the memory quota per query and the concurrency quota.

This allows the controller to increase the concurrency quota to a larger
number while setting the maximum amount of memory to a lower amount than
would be required for all queries to use 100% of their allowable memory.

Functionally, this means that a query will have a soft limit for an
initial memory byte quota that a query is guaranteed to have, a shared
pool that it is allowed access to in the case it uses more, and a hard
limit that no query may exceed to prevent runaway queries from taking
over the entire pool.

This change is completely backwards compatible with older configurations
as the new options will default to values that mimic the old behavior
where a query is allocated the full amount of its memory quota and the
maximum amount of memory is based on the concurrency quota and this
maximum memory quota.

In addition to the above, this also fixes a bug in the controller that
allowed it to run more than its concurrency as executing queries. This
happened when the results had finished being sent by the executor, but
the query had not yet been read and/or serialized. The executor would be
freed up and would take the next query even though the previous query
hadn't yet been finalized with `Done()`.
2019-10-15 09:18:00 -05:00
Jonathan A. Sternberg eacc1b0d9c
fix(query): update the QueryServiceProxyBridge to check for an error properly (#15353)
The QueryServiceProxyBridge would not check for errors properly because
it would return any error encountered when running the query as a read
error on the `io.Reader`. This made it so that the csv decoder could not
identify if the error was related to the query or if it was related to
reading. The csv decoder needed to tell the difference because an error
with reading from the `io.Reader` needs to be returned as a decoder
error while an error from the query needs to be returned as-is.

Instead of adapting the csv decoder to do that, we instead lazily
initialize the result iterator when `More()` is called and call `Peek()`
on the reader. If no bytes can be read, we assume this was an error
while executing the query and return it as such. If we are able to read
at least one byte, we decode it through the csv decoder.
2019-10-09 11:06:32 -07:00
Lyon Hill 5e1d7f6c69
feat(task): remove preauth (#15286)
* feat(task): remove preauth

* fix(task): remove e2e test that verified preauth
2019-09-26 10:52:24 -06:00
Christopher Wolff 26dbd9225c feat(query/stdlib/experimental): add experimental.to() implementation to OSS 2019-09-20 14:31:58 -07:00
Lorenzo Affetti 9532c9d170 fix(testing): skip unbounded e2e test 2019-09-19 17:51:45 +02:00
Lorenzo Affetti 2a6cfe3c78 fix(query): inject dependencies in context for BucketAccessed 2019-09-19 17:31:13 +02:00
Lorenzo Affetti 3f50cd2af9 Merge branch 'master' into flux-staging-v0.48.x 2019-09-19 17:20:40 +02:00
Jonathan A. Sternberg cbd04f2884
refactor: http error serialization matches the new error schema (#15196)
The http error schema has been changed to simplify the outward facing
API. The `op` and `error` attributes have been dropped because they
confused people. The `error` attribute will likely be readded in some
form in the future, but only as additional context and will not be
required or even suggested for the UI to use.

Errors are now output differently both when they are serialized to JSON
and when they are output as strings. The `op` is no longer used if it is
present. It will only appear as an optional attribute if at all. The
`message` attribute for an error is always output and it will be the
prefix for any nested error. When this is serialized to JSON, the
message is automatically flattened so a nested error such as:

    influxdb.Error{
        Msg: errors.New("something bad happened"),
        Err: io.EOF,
    }

This would be written to the message as:

    something bad happened: EOF

This matches a developers expectations much more easily as most
programmers assume that wrapping an error will act as a prefix for the
inner error.

This is flattened when written out to HTTP in order to make this logic
immaterial to a frontend developer.

The code is still present and plays an important role in categorizing
the error type. On the other hand, the code will not be output as part
of the message as it commonly plays a redundant and confusing role when
humans read it. The human readable message usually gives more context
and a message like with the code acting as a prefix is generally not
desired. But, the code plays a very important role in helping to
identify categories of errors and so it is very important as part of the
return response.
2019-09-19 10:06:47 -05:00
Lorenzo Affetti ab835c8e0e
refactor(dependencies): use new dependency injection framework (#15174)
refactor(dependencies): use new dependency injection framework
2019-09-19 17:01:17 +02:00
Christopher Wolff eb15b346cc chore: update to Flux v0.47.1 2019-09-18 11:51:46 -07:00
Lorenzo Affetti 95ba072f92
Merge pull request #15137 from influxdata/flux-staging-v0.47.x
build(flux): update Flux to v0.47.0
2019-09-13 19:05:42 +02:00
Jonathan A. Sternberg e99456d9d3
refactor(query/control): update a test to use the arrow allocator interface (#15138)
We are planning to change the allocator interface within flux to use the
arrow allocator. To make the release easier, this updates the test in
advance to use the arrow allocator instead of the to be changed memory
allocator interface from flux.
2019-09-13 11:51:15 -05:00
Lorenzo Affetti 7102febafd fix(testing): skip promql e2e tests 2019-09-13 18:49:00 +02:00
Stuart Carnie d56af6eb29
fix(query): Ensure tags are sorted before passing to PointsWriter
Writes directly to a PointsWriter require the tag key, value pairs
are sorted in lexicographically ascending order. This commit uses
new API from the `models` package to ensure this invariant is
maintained.
2019-09-11 16:37:57 -07:00
Jonathan A. Sternberg bea3a18330
fix(query/stdlib): use auth correctly in the v1.databases() call (#14927)
The `v1.databases()` call did not correctly filter buckets based on
auth. Fortunately, it did not cause any improper permissions such as
allowing a person to see buckets that they had no read access to.

The error instead was that if a user did not have read access to one of
the buckets that was returned, the entire command would fail rather than
filter out the bucket that didn't have permissions.

This changes it so that if the user doesn't gets an unauthorized error
when accessing a bucket, it will filter it from the list instead of
failing. It also changes it so the error message is marked as
`ENotFound` instead of as an internal error.
2019-09-05 10:35:23 -05:00
Nathaniel Cook 454003841a build(flux): upgrade to Flux v0.42.0
Skips a test that requires special dependencies to pass.
2019-08-30 13:02:30 -06:00
Jonathan A. Sternberg ae780ff468
tests(cmd/influxd/launcher): add a launcher test for the secret service (#14813)
The secret service is tested by creating a secret and then attempting to
use it in a flux query. There is one test where accessing the secret
should work and one where it should return that the action is forbidden.
2019-08-27 10:44:46 -05:00
Adam fcfdd2b1ef build(flux): update to latest flux master 2019-08-26 16:46:17 -06:00
Adam f97929614c test(query): roll back some changes to end_to_end_test.go 2019-08-26 16:46:17 -06:00
Adam 945b68b8fd fix(query): finish refactoring the repl and inject the secret service as a dependency 2019-08-26 16:46:17 -06:00
Adam 808ebb9590 fix(query): update usage of interpreter dependencies 2019-08-26 16:46:17 -06:00
Nathaniel Cook 6303e2dcc5 test(query): skip holt_winters_panic test
added executor dependencies where needed
2019-08-26 16:46:17 -06:00
Nathaniel Cook 4b339dd0cf fix(query/to): make orgID default to the context org
This change makes it so that if an org or orgID are missing on calls to the `to` function
that the orgID is retrieved from the request context.

This is consistent with how `from` works.
2019-08-23 11:03:26 -06:00
Nathaniel Cook 6b54abb51e test(query): skip holt_winters_panic test 2019-08-22 13:11:13 -06:00
docmerlin (j. Emrys Landivar) 19fe098888 chore(ci): update go-tools 2019-08-22 10:55:05 -05:00
Jonathan A. Sternberg 11aae144b2
feat(query): wrap the secret service for flux (#14732)
The secret service is wrapped to be compatible with the flux interface
to the secret service.

The organization id is not part of the flux interface so this code
extracts the organization id from the query context so that it can lookup
a secret within the organization.
2019-08-22 10:47:02 -05:00
Nathaniel Cook 7498c06d3f test(query): skip check and http_endpoint Flux tests 2019-08-21 09:59:01 -06:00
Nathaniel Cook 6a0fa44093 fix(query): update code for changes to scoped compiler 2019-08-21 09:59:01 -06:00
Nathaniel Cook 1b8ab3c2f2 fix(query): remove http.to and update test cases that used it 2019-08-21 09:59:01 -06:00
Christopher M. Wolff c61646d0f4 feat(query/stdlib): add an experimental "to" function (#14664) 2019-08-21 09:59:01 -06:00
Nathaniel Cook cd2bfb9b22 refactor(query/stdlib): update tests for new Flux test name conventions (#14669) 2019-08-21 09:59:01 -06:00
Jonathan A. Sternberg b35552721c
fix(query/control): handle flux errors from the table iterator in the controller (#14715) 2019-08-20 12:20:40 -05:00
Stuart Carnie 9d94b7500d
fix(flux): Fix hanging test by ensuring results are read
Closes #14574
2019-08-12 16:47:03 -07:00