Commit Graph

828 Commits (master)

Author SHA1 Message Date
Jeffrey Smith II f74c69c5e4
chore: update to go 1.20 (#24088)
* build: upgrade to go 1.19

* chore: bump go.mod

* chore: `gofmt` changes for doc comments

https://tip.golang.org/doc/comment

* test: update tests for new sort order

* chore: make generate-sources

* chore: make generate-sources

* chore: go 1.20

* chore: handle rand.Seed deprecation

* chore: handle rand.Seed deprecation in tests

---------

Co-authored-by: DStrand1 <dstrandboge@influxdata.com>
2023-02-09 14:14:35 -05:00
Jeffrey Smith II 06a59020d0
fix: prevent unauthorized writes in flux "to" function (#24077)
* fix: prevent unauthorized writes in flux "to" function

* test: add test for "to" permissions fix
2023-02-06 10:07:18 -05:00
Nathaniel Cook a321e72d15
build(flux): update flux to v0.185.0 (#23775) 2022-10-05 08:25:58 -06:00
Owen Nelson eada36bd97
test: remove group skips (#23720)
* test: remove group skips

* test: inline previously extended testcases that broke with added sort

Some tests had a sort added so they'd pass in cloud, vanilla, and OSS.
This also broke some extended testcases here in OSS since pushdown rules
no longer match the plan.

This diff "inlines" the testcase body for each of these so we get our
coverage back, but leaves a FIXME to note that it would be better if we
could somehow thread the needle and retain the extension.
2022-09-27 12:04:36 -07:00
Christopher M. Wolff aa9c49e9f5
build(flux): update flux to v0.180.1 (#23666)
* chore: make tests robust to Flux formatter changes
2022-08-24 11:59:16 -07:00
Christopher M. Wolff 78c969e510
build(flux): update flux to v0.178.0 (#23615) 2022-08-09 13:53:22 -07:00
Jonathan A. Sternberg a9f751f44a
feat(query): add planner rule for converting aggregate window to a push down (#23586) 2022-07-26 10:19:26 -05:00
Markus Westerlind 69a95dc2d6
fix: Update the condition when reseting cursor (#23522)
Filters that contain `or` may change between cursor resets so we must remember to update the condition in the read cursor.

```flux
|> filter(fn: (r) => ((r["_field"] == "field1" and r["_value"]==true) or (r["_field"] == "field2" and r["_value"] == false)))
```

Closes https://github.com/influxdata/flux/issues/4804
2022-07-08 18:50:42 +01:00
Christopher M. Wolff a492993012
build(flux): update flux to v0.171.0 (#23453)
* build(flux): update flux to v0.171.0

* chore: remove testing.loadStorage from tests

Also update skip lists in Flux test harness

* chore: remove now redundant Go end-to-end unit tests

This testing is all now provided by the `fluxtest` harness.
2022-06-14 15:09:59 -07:00
Jonathan A. Sternberg 2e9e174c24
fix(query/control): add all of the statistics from flux statistics instead of only metadata (#23375)
This changes the statistics merging to use the `Add` method on the
entire statistics struct instead of only the metadata. The purpose of
this is that we want to utilize the existing function for merging the
statistics so that additional properties can be added without modifying
the query controller.

At the same time, there are certain properties that are computed in the
controller and we want to ensure they aren't double counted if flux
starts computing these itself. So we blacklist certain attributes that
we compute so that if flux is modified to return these values, we just
ignore them until we change our own code to use those values.

In immediate terms, we're changing to use the `Add` method so that we
can add profiles to the statistics and have those profiles propagate to
the query controller. This property doesn't exist yet so we can't add it
and we don't want to add it after flux is modified because it could
break the operator profile.

But, we also don't want to only use `Add` because we want to move the
properties such as `TotalAllocated` and `TotalDuration` into flux itself
and to remove the controller. But, the controller needs to be compatible
with whatever changes we make to flux so that there's no circumstance
where functionality stops working.
2022-05-26 09:28:18 -05:00
Brandon Pfeifer d9065071e9
chore: upgrade flux to v0.167.0 (#23348)
* fix(fluxtest): update Flux tests for new option support

The Flux test harness now allows inheriting options, this updates the
test cases with the new syntax and simplifies any tests that had to
duplicate the options.

* build(flux): update flux to v0.165.0

* chore: upgrade flux to v0.167.0

Co-authored-by: Nathaniel Cook <nvcook42@gmail.com>
Co-authored-by: Paul Hummer <paul@eventuallyanyway.com>
2022-05-17 15:59:44 -04:00
Alfonso Acosta c535994992
fix: remove controller 64bit misalignment (#23260)
See https://pkg.go.dev/sync/atomic#pkg-note-BUG fore more details
2022-04-14 14:22:47 -05:00
Dane Strandboge 82d1123e78
build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
Jonathan A. Sternberg 5231d2d197
feat(query): enable the mqtt pool dialer by default (#23226) 2022-03-24 12:35:10 -05:00
Jonathan A. Sternberg 5e3ea7b94c
refactor(flux): convert the allocator into an interface (#23214)
This follows the changes from influxdata/flux#4539.
2022-03-22 12:33:52 -05:00
Jamie Strandboge 2c930fd127
feat: add --hardening-enabled option to limit flux/pkger HTTP requests (#23207)
Flux HTTP and template fetching requests do not perform IP address
checks for local addresses. This behavior on the one hand allows SSRF
(Server Side Request Forgery) attacks via authenticated requests but on
the other hand is useful for scenarios that have legitimate requirements
to fetch from private addresses (eg, hosting templates internally or
performing flux queries to local resources during development).

To not break existing installations, the default behavior will remain
the same but a new --hardening-enabled option is added to influxd to
turn on IP address verification and limit both flux and template
fetching HTTP requests to non-private addresses. We plan to enable new
security features that aren't suitable for the default install with this
option.  Put another way, this new option is intended to be used to make
it easy to turn on all security options when running in production
environments. The 'Manage security and authorization' section of the
docs will also be updated for this option.

Specifically for flux, when --hardening-enabled is specified, we now
pass in PrivateIPValidator{} to the flux dependency configuration. The
flux url validator will then tap into the http.Client 'Control'
mechanism to validate the IP address since it is called after DNS lookup
but before the connection starts.

For pkger (template fetching), when --hardening-enabled is specified,
the template parser's HTTP client will be configured to also use
PrivateIPValidator{}. Note that /api/v2/stacks POST ('init', aka create)
and PATCH ('update') only store the new url to be applied later with
/api/v2/templates/apply. While it is possible to have InitStack() and
UpdateStack() mimic net.DialContext() to setup a go routine to perform a
DNS lookup and then loop through the returned addresses to verify none
are for a private IP before storing the url, this would add considerable
complexity to the stacks implementation. Since the stack's urls are
fetched when it is applied and the IP address is verified as part of
apply (see above), for now we'll keep this simple and not validate the
IPs of the stack's urls during init or update.

Lastly, update pkger/http_server_template_test.go's Templates() test for
disabled jsonnet to also check the contents of the 422 error (since the
flux validator also returns a 422 with different message). Also, fix the
URL in one of these tests to use a valid path.
2022-03-18 10:25:31 -04:00
Sam Arnold df01d93d8b
fix: allow flux http calls to be unlimited (#23191) 2022-03-15 10:01:20 -04:00
Sam Arnold 7c0ec4dd2c
fix: replications replicates flux to() writes (#23188)
Fixes a few issues:
* flux needs to write to the replication service, instead of the engine directly.
* the replication service incorrectly had value receiver methods, I think this
was just an accident. Pointer receivers make things easier to reason about. Also
with value receivers flux was not picking up the replication config properly.
* The flux to() function previously did not receive the org properly for internal
writes. Previously this was not necessary as the write path only needs the bucket
ID at this level (after authentication). But now we need the org id to look up
replications properly.

Closes #23183
2022-03-14 12:17:58 -04:00
Paul Hummer 36df687aa8
build(flux): update flux to v0.158.0 (#23175)
* build(flux): update flux to v0.158.0
* chore(upgrade_arrow): upgrade to apache arrow 7
2022-03-10 10:54:41 -08:00
Jonathan A. Sternberg adf29dfedf
feat(kit/feature): allow influxdb to set flux feature flags (#23123) 2022-02-24 15:29:17 -06:00
Jonathan A. Sternberg afb9733072
build(flux): update flux to v0.156.0 (#23142)
* build(flux): update flux to v0.156.0

* chore(flux/schema): update schema tests to assert planner rules

The schema test where updated in Flux, this updates them here so that we
can assert that the planner rules are applied. See note about copied
data.

Co-authored-by: Nathaniel Cook <nvcook42@gmail.com>
2022-02-22 13:27:23 -06:00
Jonathan A. Sternberg c4717ef469
refactor(query): remove detailed query traces (#23125)
We're removing this functionality from flux because it doesn't work
properly so remove the invocations here.
2022-02-17 11:54:38 -06:00
Jonathan A. Sternberg 2a957c9a56
chore(query/influxql): remove the influxql transpiler (#23000) 2022-01-31 11:34:37 -05:00
William Baker b02c89edf6
feat: option to log flux queries cancelled because of server shutdown (#23032)
Co-authored-by: DStrand1 <dstrandboge@influxdata.com>
2022-01-11 16:06:36 -06:00
Christopher M. Wolff a812d8b603
build(flux): update flux to v0.148.0 (#23047) 2022-01-11 11:30:01 -08:00
William Baker afb167a2ca
feat: `query-memory-bytes` zero-value is unlimited (#23013) 2021-12-20 19:25:10 -05:00
Sam Arnold dece95d1dd
feat: tsm compaction metrics via prometheus (#22904)
* feat: tsm compaction metrics via prometheus

* chore: fix formatting

* chore: make activeCompactions a pointer
2021-11-19 14:51:22 -05:00
Andrew Lamb ca633cdfaf
chore: Remove outdated query readme (#22608) 2021-11-03 09:13:00 -04:00
Dane Strandboge f4e9ae94ca
build: upgrade protobuf library (#22654) 2021-11-02 16:00:54 -05:00
Daniel Moran 401af4b3ae
feat(flux): enable writing to remote hosts via `to()` and `experimental.to()` (#22634) 2021-10-12 09:35:44 -07:00
Jonathan A. Sternberg 708e808d00
feat(query/stdlib): update window planner rules for location changes to support fixed offsets (#22635)
The pushdown does not support fixed offsets or non-UTC locations, but it
does now correctly compile and pushdown other windows.
2021-10-07 15:29:38 -05:00
Jonathan A. Sternberg a01d42db37
feat(query/stdlib): update push down window logic for location option (#22607) 2021-10-01 14:27:37 -05:00
Daniel Moran 02246a8c3e
test: wait until time.Now changes before checking timing stats in query controller tests (#22479)
This allows the tests to pass on Windows, where time.Now doesn't update as frequently as it does on other systems
2021-09-20 08:26:16 -04:00
William Baker 1f66b3110e
fix: upgrade influxql to latest version & fix predicate handling for show tag values metaqueries (#22500)
* feat: Add WITH KEY to show tag keys

* fix: add tests for multi measurement tag value queries

* chore: fix linter problems

* chore: revert influxql changes to keep WITH KEY disabled

* chore: add TODO for moving flux tests to flux repo

Co-authored-by: Sam Arnold <sarnold@influxdata.com>
2021-09-17 11:14:03 -06:00
Sam Arnold 5015297d40
fix: more expressive errors (#22448)
* fix: more expressive errors

Closes #22446

* fix: server only logging for untyped errors

* chore: fix formatting
2021-09-13 15:12:35 -04:00
William Baker 3e275a123d
feat: multi-measurement query optimization (#22301)
* feat: multi-measurement query optimization
2021-09-13 13:00:08 -06:00
William Baker 1482bdfa38
feat: partial support for series cardinality flux query (#22378) 2021-09-09 12:37:11 -06:00
Daniel Moran 29ef6dc562
test: skip HoltWinters tests when GOARCH != amd64 (#22414) 2021-09-07 16:15:31 -04:00
William Baker 279c23a0c6
feat: add additional log to flux e2e tests (#22366) 2021-09-02 11:16:01 -06:00
Daniel Moran cc6accf106
chore: delete old-style DBRP mapping (#22339) 2021-08-30 18:27:11 -04:00
Daniel Moran f251415a20
chore: delete unused, broken 'compspecs' testing tool (#22335) 2021-08-30 17:09:06 -04:00
Jonathan A. Sternberg f94783e016
build(flux): update flux to master and change renamed structs (#22281) 2021-08-26 10:07:02 -05:00
Daniel Moran 07d897d2f2
fix: switch flux formatter to one that preserves comments (#22186) 2021-08-12 14:17:18 -04:00
William Baker 2339432132
chore: remove duplicate flux test (#22035)
* chore: remove duplicate flux test

* test: convert to a pushdown test
2021-08-04 08:38:43 -06:00
Jonathan A. Sternberg d0b1f5a80e
feat: update flux components to use flux/array instead of arrow/array (#21971)
This updates the flux integration to use the `flux/array` package rather
than directly using the `arrow/array` package.

Flux recently switched to wrapping the array types from arrow and
creating its own array package to be used for table columns instead of
directly referencing the arrow package. This allows us to keep a
consistent interface, but potentially change internal implementations
without changing downstream consumers. Most recently, the
`*array.String` type has some of its own optimizations for certain array
patterns.

This change updates the flux integration to use the new API.
2021-07-29 15:31:31 -05:00
William Baker 8e80798c33
fix: field metaqueries take fast path if predicate is only on `_measurement` (#21962)
* fix: field metaqueries take fast path if predicate is only on `_measurement`

* chore: update CHANGELOG

* test: add test for fields with measurement predicate
2021-07-29 13:57:06 -06:00
Daniel Moran 5d84c602c8
build: upgrade staticcheck, fix new linter warnings (#21957) 2021-07-27 20:37:23 -04:00
Christopher M. Wolff 9ecddda5ae
test: add acceptance tests and table tests for group|>first/last (#21853) 2021-07-15 09:53:51 -07:00
Christopher M. Wolff 66d9ee8751
test: add tests for group and count/sum (#21852) 2021-07-15 09:52:29 -07:00
Jonathan A. Sternberg 0fec03bbfa
refactor(query): rename the kind for experimental-to so that it is different from native flux (#21834)
The kind for experimental-to is in conflict with the one used by native
flux. In the past, native flux didn't use the kind and expected
implementations to register their own procedure spec with that value.

In the latest Flux, this isn't the case and it is using the kind for a
native implementation. As we have not implemented the requirements for
the native implementation, we are still replacing the procedure spec but
using a different name that's unique to our implementation.
2021-07-12 13:08:17 -05:00