Commit Graph

35 Commits (7ea1db0079f7fad3049d61ffc6ea49f7835cb735)

Author SHA1 Message Date
Christopher M. Wolff a28dfe8f79
fix(query): restore error messages in repl (#1936)
Fixes #1932
2018-12-13 14:11:17 -08:00
Christopher M. Wolff c9ec2dd07f
fix(query): set error code "invalid" when controller reports error (#1812)
Fixes flux#268
2018-12-11 07:57:32 -08:00
Mark Rushakoff a06d4dea16 refactor(query): explicitly shut down query controller
The flux query controller was updated to include a Shutdown method a
while ago. Explicitly handle query controller creation and shutdown
where applicable.

In influxd, this ensures that outstanding queries are handled before the
process dies. In tests, this ensures that query controller goroutines
aren't leaked, which drastically simplifies reading full stack traces.

This change also registers query controller metrics with the prometheus
registry in influxd.
2018-11-26 16:13:19 -08:00
Nathaniel Cook 672e2d5fe7 chore: Updates to be able to remove platform as a dependency of Flux 2018-09-12 10:18:54 -06:00
Stuart Carnie ac75af2f58 refactor: Migrate query package to influxdata/flux repository 2018-09-06 11:13:48 -07:00
Jonathan A. Sternberg aa052e1a57 feat(query/plan): make it possible to configure the default memory limit for queries
The previous default was just to have no limit at all. This adds a
configuration option to the planner so a static value can be set for the
memory limit on each individual query.
2018-08-28 16:24:49 -05:00
Jonathan A. Sternberg 1129552475 feat(query): log panics with their stacktraces within the query executor
The logger is now threaded into the query controller, executor, and the
dispatcher so that we can log panics. They are logged at the info level
because the panics do not result in the system crashing and becoming
unusable.
2018-08-15 16:03:12 -05:00
Jonathan A. Sternberg 27c59297bc fix(query/control): fix the queueing metric
We decremented all, but forgot to decrement queueing when it was set and
the query spec could not be validated.
2018-08-14 16:02:46 -05:00
Jonathan A. Sternberg 9f829ae5bf fix(query/control): remove a deadlock
The call to `setErr` would grab a lock that `Pop` used, but `setErr`
requires the controller run loop to be executing for it to work. If we
reverse the order of these calls, it should be fine.
2018-08-14 15:49:15 -05:00
Jonathan A. Sternberg 46605ac6b3 fix(query/control): finish the parent span once
When the controller moves to one of the finished states, it will finish
the parent span so that can be recorded. It presently will do this
multiple times when transitioning between different finished states.
2018-08-14 11:45:25 -05:00
Jonathan A. Sternberg f6e5feacbe fix(query/control): finish the parent span if compiling or queueing fails
This normally happens within the finishing states, but when compiling or
queueing fails it never enters those finished states and is instead
discarded. We need to signal that the query itself has finished in the
metrics.
2018-08-14 11:29:34 -05:00
Jonathan A. Sternberg c38e68c4b1
Merge pull request #570 from influxdata/js-document-query-control-package
docs(query/control): document the query/control package
2018-08-13 15:56:22 -05:00
Jonathan A. Sternberg a563ab4f34 docs(query/control): document the query/control package
This documents the responsibilities of what the Controller does and is
expected to do. It describes some behaviors that aren't implemented, but
acts as a guide for what the Controller should do as we continue
developing the query engine and improving the internal mechanics.
2018-08-13 15:49:14 -05:00
Nathaniel Cook 5bde0b5be6 fix: Update query services to use Request type
Moves idpe.QueryService into platform/query.ProxyQueryService
Splits the Request into ProxyRequest and Request.

Changes query.QueryService and query.AsyncQueryService to use a Request
type. This means that the Compiler interface is consumed by the service
to abstract out transpilation vs Flux compilation vs raw spec.

The transpiler handler is removed.

There are separate http handlers and service implementations for each of
the three query services.

Query logging types are moved into platform.

The ResultIterator now expects Cancel to always be called.

The fluxd binary exposes the query endpoint specified in the swagger
file.
2018-08-08 15:31:35 -06:00
Michael Desa 8c87c9d132 revert #442 2018-08-01 14:54:32 -04:00
Leonardo Di Donato 0778344cb0 Refactoring query package 2018-08-01 18:20:59 +02:00
Nathaniel Cook 21286235dd fix: Fix deadlock in query stats 2018-07-27 14:55:38 -06:00
Nathaniel Cook 920ef30a99 Merged pull request #494 from influxdata/nc-query-panic
fix: Panic in query/controller on Statistics
2018-07-27 09:30:49 -06:00
Nathaniel Cook 47b7f512da fix: Panic in query/controller on Statistics 2018-07-27 09:15:28 -06:00
jlapacik 69e3627f42 controller sets Now time before enqueuing a query 2018-07-26 10:36:19 -07:00
Jonathan A. Sternberg ff8c9cfb34 fix(query/control): cancel the enqueue of a query if the context finishes
If a query is attempting to be enqueued and it gets canceled, it will
now stop attempting to add it to the new queries queue and return the
error reported by the context. This allows the http server to cancel a
running query when the client disconnects for whatever reason without
continuing to attempt to process the canceled query.
2018-07-18 15:37:25 -05:00
Nathaniel Cook 85b7d36147 feat: Add query statistics
Introduces the Statisticser interface which ResultIterators may
implement.

The HTTP implementation uses HTTP trailers to preserve the statistics.
This way we do not need to have all encoders and decoders support
statistics.
2018-07-17 09:16:27 -06:00
jlapacik 524c4ccf35 flux options interface
default now option value
2018-07-16 14:24:37 -07:00
Jonathan A. Sternberg 4a275e0e2e feat(query/control): catch panics when executing a query in the controller 2018-07-12 17:16:12 -05:00
Jonathan A. Sternberg 3d67f92c82
Merge pull request #397 from influxdata/nc-controller-panic
fix(query): Fix panic in controller if planning errors
2018-07-12 12:50:30 -05:00
Nathaniel Cook 932c114649 fix(query): Fix panic in controller if planning errors 2018-07-12 11:47:34 -06:00
Mark Rushakoff 15efa9d411 chore(query/control): use non-global prometheus metrics 2018-07-11 16:54:23 -07:00
Jonathan A. Sternberg b9a4f1be74 fix(query/control): race condition when attempting to plan a query in the controller 2018-07-09 15:40:07 -05:00
Jonathan A. Sternberg 9615528e31 fix(query/control): discard finished queries from the priority queue 2018-07-09 13:27:14 -05:00
Nathaniel Cook 41b822380b chore: Make control.Controller implement AsyncQueryService 2018-06-25 15:24:40 -06:00
Mark Rushakoff c74bcd11b4 chore(query): remove usage of query/id package
It was effectively a copied and pasted platform.ID, so change it to a
type alias. Once our known references to the query/id package are
updated to platform.ID, we'll delete the package.
2018-06-20 12:55:20 -07:00
Mark Rushakoff 34e4a2f8ac fix(query/control): use Lock to avoid data race
The previous code used RLock even though it was modifying a field. I
observed a data race locally due to concurrent access on that field.
2018-06-13 08:22:00 -07:00
Nathaniel Cook affc7e3976 move types around to avoid cyclic imports 2018-05-21 17:02:42 -06:00
Nathaniel Cook 20345b8701 rewrite imports 2018-05-21 15:20:06 -06:00
Nathaniel Cook 51b8aebebf initial copy of ifql repo 2018-05-21 15:18:56 -06:00