Commit Graph

1182 Commits (afbbfaca879c049e280ff482f6bf36ea8aa1ea08)

Author SHA1 Message Date
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
William Baker 88d6487f4a
feat: extended downgrade command to include sql migrations (#22813)
* feat: extended downgrade command to include sql migrations

* feat: remove short forms in downgrade command
2021-11-02 10:42:02 -06:00
William Baker f7573f43a7
feat: sql migrator can do down migrations (#22806)
* feat: sql down migrations

* refactor: different name for up migrations

* chore: update migrations ref in svc tests

* build: add lint step to verify sql migration names match
2021-11-01 14:30:18 -06:00
Daniel Moran eedd84671b
feat: initialize `influxd downgrade` command to run `Down()` migrations on metadata (#22800) 2021-10-29 16:34:01 -04:00
Daniel Moran 335b74b25f
feat: take a backup of KV/SQL metadata stores before applying migrations (#22765) 2021-10-28 16:02:15 -04:00
mcfarlm3 8825cd5d50
feat: replication apis durable queue management (#22719)
* feat: added durable queue management to replications service

* refactor: improved mapping of replication streams to durable queues

* refactor: modified replication stream durable queues to use user-specified engine path

* chore: generated test mocks for replications DurableQueueManager

* chore: add test coverage for replications durable queue manager

* refactor: made changes based on code review, added mutex to durableQueueManager, improved error logging

* chore: ran make fmt

* refactor: further improvements to error logging
2021-10-26 12:14:29 -07:00
Daniel Moran 58139c47b2
feat: add auth to remotes & replications APIs (#22744) 2021-10-26 11:32:35 -04:00
Daniel Moran 7171e0752a
test: wait for time.Now to change before updating stack in pkger test (#22735)
Do this so comparisons between creation time and update time are realistic.
2021-10-22 16:20:17 -04:00
Dane Strandboge de7f052e5a
chore: fix `dump_tsi` deadlock (#22705) 2021-10-20 12:43:02 -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
Daniel Moran 7b7d4f3856
fix(upgrade): don't drop shard-group durations when upgrading DBs (#22650)
Add KV migration to repair missing shard-group durations
2021-10-11 14:43:57 -07:00
Sam Arnold a02782c63f
feat: return new operator token during backup overwrite (#22629)
* feat: return new operator token during backup overwrite

* chore: update swagger

* test: e2e restore test with new token
2021-10-07 09:07:09 -04:00
Sam Arnold 1542d2404f
feat: new recovery subcommand allows creating recovery user/token (#22590)
* feat: influxd recovery-cli allows creating recovery user/token

Closes #12051

* test: do not assert order of users or orgs in list

* fix: code review suggestions from dan

Co-authored-by: Daniel Moran <danxmoran@gmail.com>

* fix: more fixes from dan's review

* chore: depend on tabwriter from influx-cli

* chore: revert onboarding refactor

Co-authored-by: Daniel Moran <danxmoran@gmail.com>
2021-10-06 12:37:36 -04:00