Commit Graph

769 Commits (8ed55e72b85b0807c97d3d1d7d12e9f07c9737e9)

Author SHA1 Message Date
Manuel de la Peña 26daa86648
chore: bump testcontainers to latest released version (#23858)
* chore: bump testcontainers to v0.15.0

* chore: run go mod tidy

* chore: update test to latest version of testcontainers

* chore: update package

* fix: use collectors.NewGoCollector instead

SA1019 detected by staticcheck
2022-11-23 13:18:10 -05:00
Jeffrey Smith II c2eac86131
feat: port report-db command from 1.x (#23922)
* feat: port report-db command from 1.x

* chore: fix linting

* chore: rename db to bucket

* chore: fix linting
2022-11-21 11:23:13 -05:00
Jeffrey Smith II 77081081b5
feat: port check-schema and merge-schema from 1.x (#23921)
* feat: add check-schema and merge-schema commands to influx inspect

* chore: fix linting

* fix: add warning if fields.idxl is encountered
2022-11-21 10:39:50 -05:00
Jeffrey Smith II 9bf8840a63
fix: update me and users routes to match cloud/documentation (#23837)
* fix: update me and users routes to match cloud/documentation

* fix: handle errors in user routes properly
2022-11-21 10:39:30 -05:00
Dane Strandboge 6fc66acb0a
fix: do not require remoteOrgID in remote config/creation request (#23838) 2022-11-01 09:47:45 -05:00
Jeffrey Smith II 3ac7a10aa9
fix: downgrading to 2.3 was broken (#23814) 2022-10-19 15:13:39 -04:00
Jeffrey Smith II 2ad8995355
fix: improve delete speed when a measurement is part of the predicate (#23786)
* fix: improve delete speed when a measurement is part of the predicate

* test: add test for deleting measurement by predicate

* chore: improve error messaging and capturing

* chore: set goland to use the right formatting style
2022-10-14 15:09:32 -04:00
Jeffrey Smith II a0f1184bb3
fix: manually scheduled task runs now run when expected (#23664)
* fix: run manually scheduled tasks at their scheduled time

* fix: actually use it

* fix: get tests building

* fix: fix tests

* fix: lint
2022-10-13 14:57:57 -04:00
Owen Nelson d8553c002e
test(flux): use vanilla flagger for fluxtest (#23762)
* test(flux): set flux flagger in launcher

* test(flux): use default flagger from vanilla

* test(flux): unskip vectorized float tests

* test(flux): remove redundant skips for already-tagged integration tests

* test(flux): remove skips requiring `removeRedundantSortNodes` flag

* test(flux): remove skips requiring `labelPolymorphism` flag
2022-10-05 13:42:38 -07:00
Nathaniel Cook a321e72d15
build(flux): update flux to v0.185.0 (#23775) 2022-10-05 08:25:58 -06:00
Abirdcfly c433342830
chore: remove duplicate word in comments (#23685)
Signed-off-by: Abirdcfly <fp544037857@gmail.com>

Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-09-13 11:00:52 -05:00
Jeffrey Smith II 6f50e70960
feat: replicate based on bucket name rather than id (#23638)
* feat: add the ability to replicate based on bucket name rather than bucket id.

- This adds compatibility with 1.x replication targets

* fix: improve error checking and add tests

* fix: add additional constraint to replications table

* fix: use OR not AND for constraint

* feat: delete invalid replications on downgrade

* fix: should be less than 2.4

* test: add test around down migration and cleanup migration code

* fix: use nil instead of platform.ID(1) for better consistency

* fix: fix tests

* fix: fix tests
2022-08-18 14:21:59 -04:00
Nathaniel Cook 07bab31fe6
build(flux): update flux to v0.173.0 (#23505)
* build(flux): update flux to v0.173.0

* fix(fluxfmt): update tests for newline in Flux fmt

Flux fmt now explicitly adds a newline to the end of a file, updating
tests accordingly.
2022-06-30 11:39:07 -06:00
Sam Arnold 21885a7c33
fix: log the log level at startup (#23472) 2022-06-17 14:30:26 -04:00
Jeffrey Smith II 090f681737
feat: Add remotes and replications to telemetry (#23456)
* feat: start work on remotes/replications phone home data

* feat: add remotes/replications phone home data (no tests

* refactor: use erroring binary conversions

* style: gofmt

* refactor: improve some error handling

* style: cleanup

* feat: add tests

* refactor: just list remotes/replications rather than decrement

* chore: linting fix

Co-authored-by: DStrand1 <dstrandboge@influxdata.com>
2022-06-16 14:48:06 -04:00
Dane Strandboge 9e556864a3
fix: replications remote write failure can deadlock remote writer (#23458) 2022-06-16 11:57:24 -05:00
Jeffrey Smith II 692b0d5153
feat: add instance-id flag for identifying edge nodes (#23447)
* feat: add instance-id flag for identifying edge nodes

* refactor: rename tag to _instance_id
2022-06-16 12:18:11 -04:00
Jeffrey Smith II d705841a00
feat: error when creating v1 auth with a nonexistent bucket id (#23422)
* feat: error when creating v1 auth with a nonexistent bucket id

* fix: only check for buckets

* refactor: test cleanup for clarity
2022-06-13 15:52:28 -04:00
Jamie Strandboge ab8be8016b
chore: update jsonparser to 1.1.1 and yaml.v3 to 3.0.1 (#23385)
* chore: update jsonparser to 1.1.1 and yaml.v3 to 3.0.1

Perform:

  $ go mod edit -require github.com/buger/jsonparser@v1.1.1
  $ go mod edit -require gopkg.in/yaml.v3@v3.0.1
  $ go mod tidy

* chore(tests): adjust for whitespace in test output
2022-06-01 11:20:37 -05:00
Dane Strandboge 82d1123e78
build: upgrade to Go 1.18.1 (#23252) 2022-04-13 15:24:27 -05:00
Jonathan A. Sternberg 72c4c55609
build(flux): update flux to v0.162.0 (#23255) 2022-04-05 16:10:41 -05:00
Dane Strandboge 359fcc46b5
feat: add maximum age to replication queues (#23206)
Co-authored-by: Sam Arnold <sarnold@influxdata.com>
2022-03-25 13:06:05 -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 a40e12b615
feat: allow changing a password with `influxd recovery user update` (#23202)
Closes: #23158
2022-03-18 08:04:29 -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
mcfarlm3 0c5bedfd98
refactor: improve logging during influxd upgrade to give mapping metadata at info level (#23117) 2022-02-28 16:30:18 -06:00
Sam Arnold e5ccbb8831
fix: forbid reading OSS buckets for a token with only write permissions (#23148)
* fix: forbid reading OSS buckets for a token with only write permissions

We previously enabled write tokens to also find DBRP buckets, in order to allow
the legacy /write (not /api/v2/write) endpoint to read the DBRP mappings and
find the real bucket id to write to.

This had the unintended consequency of allowing tokens with only write permissions
to read data in buckets via the legacy /query (not /api/v2/query) endpoint with
InfluxQL.

This change fixes the behaviour to allow writing to /write with a write-only
token, while forbidding reading from /query.

* fix: nanosecond precision in tests
2022-02-24 09:59:14 -05:00
Sam Arnold e20b5e99a6
fix: remove nats for scraper processing (#23107)
* fix: remove nats for scraper processing

Scrapers now use go channels instead of NATS and interprocess communication.
This should fix #23085 .

Additionally, found and fixed #23106 .

* chore: fix formatting

* chore: fix static check and go.mod

* test: fix some flaky tests

* fix: mark NATS arguments as deprecated
2022-02-10 11:23:18 -05: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
William Baker 4f74049a52
feat: add downgrade target for 2.1 (#23029) 2021-12-29 13:27:07 -05:00
William Baker a8ca413d14
chore: add deprecation notice for print-config command (#23026) 2021-12-28 13:54:17 -05:00
William Baker f78f9eda9c
feat: api/v2/config endpoint displays runtime configuration (#23003)
* feat: api/v2/config endpoint for runtime config

* feat: use a type switch

* fix: add tests

* chore: add config key to returned json

* chore: update swagger ref
2021-12-23 09:27:39 -05:00
William Baker afb167a2ca
feat: `query-memory-bytes` zero-value is unlimited (#23013) 2021-12-20 19:25:10 -05:00
William Baker c51a0df1ef
feat: error out when config file contains 1.x config values (#22996)
* feat: error out when config file contains invalid options

* feat: debug logging when loading a config file

* fix: only detect flags from 1.x

* test: update tests to use toml configs
2021-12-15 20:57:01 -06:00
William Baker 5a919b69d7
feat: enable remotes and replication streams feature (#22990) 2021-12-13 16:01:50 -06:00
William Baker e4e16335f5
fix: replications remote writes do not block server shutdown (#22958)
* fix: replications remote writes do not block server shutdown

* fix: don't leak goroutine
2021-12-02 12:04:52 -06:00
Sam Arnold b970e359dc
feat: remaining storage metrics from OSS engine (#22938)
* fix: simplify disk size tracking

* refactor: EngineTags in tsdb package

* fix: fewer compaction buckets and dead code removal

* feat: shard metrics

* chore: formatting

* feat: tsdb store metrics

* feat: retention check metrics

* chore: fix go vet

* fix: review comments
2021-12-02 09:01:46 -05:00
William Baker 3460f1cc52
feat: replication remote writes do not block local writes (#22956)
* feat: replication remote writes do not block local writes
2021-12-01 15:37:10 -06:00
William Baker 906015023c
test: add e2e test for replication streams (#22949)
* test: add e2e test for replication streams

* chore: fix race
2021-12-01 11:12:44 -06:00
Sam Arnold 8aa3a8f7e5
fix: add causal error when meta.db is missing (#22905) 2021-11-24 13:05:35 -05:00
Sam Arnold edb21abe91
feat: metrics for wal subsystem (#22918)
https://github.com/influxdata/influxdb/issues/20026
2021-11-23 12:17:52 -05:00
Sam Arnold feb459c785
feat: metrics for cache subsystem (#22915)
* fix: drop complicated cache metrics and document remaining

* feat: metrics for cache
2021-11-23 10:11:22 -05:00
William Baker 3a81166812
feat: added metrics collection for replications (#22906)
* feat: added metrics collection for replications

* fix: fixed panic when restarting

* fix: fix panic pt2

* chore: self-review fixes

* chore: simplify test
2021-11-22 11:40:03 -06: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
Sam Arnold 9d8173c9f3
chore: delete dead pprof related code (#22892) 2021-11-18 08:28:17 -05:00
Jakub Bednář fa9ba8e86f
fix: duplicated X-version and X-Build headers for /ping endpoint (#22862)
* fix: duplicated X-version and X-Build headers for /ping endpoint

Signed-off-by: Jakub Bednar <jakub.bednar@gmail.com>

* chore: change branch to master

* chore: only http/handler.go is responsible for sets headers

Signed-off-by: Jakub Bednar <jakub.bednar@gmail.com>
2021-11-12 13:32:12 -07:00
Daniel Moran 6b56af3c3f
feat: mirror writes to registered replications (#22833) 2021-11-10 08:25:47 -05:00
mcfarlm3 cd0243d2b4
feat: added replications queue management to launcher tasks (#22820)
* feat: added replications queue management to launcher tasks

* refactor: separated sql logic into replications service rather than durable queue manager

* refactor: extended replications feature flag to launcher code and minor change to startup function param

* chore: added unit test coverage for replications server startup queue management

* refactor: made error messages reusable and factored out unecessary string from queue management tests

* refactor: changed queue management error names to pass linter check
2021-11-09 11:32:07 -08:00