Commit Graph

253 Commits (fix/docker-python-deps-earlier)

Author SHA1 Message Date
Trevor Hilton 4dc61df77f
chore: update to latest influxdb3_core (#26429)
* chore: update to latest core

* chore: allow CDLA permissive 2 license

* chore: update insta snapshot for new internal df tables

* test: update assertion in flightsql test

* fix: object store size hinting workaround in clap_blocks

Applied a workaround from upstream to strip size hinting from the object
store get request options. See:

https://github.com/influxdata/influxdb_iox/issues/13771

* fix: query_executor tests use object store size hinting workaround

* fix: insta snapshot test for show system summary command

* chore: update windows- crates for advisories

* chore: update to latest sha on influxdb3_core branch

* chore: update to latest influxdb3_core rev

* refactor: pr feedback

* refactor: do not use object store size hint layer

Instead of using the ObjectStoreStripSizeHint layer, just provide the
configuration to datafusion to disable the use of size hinting from
iox_query.

This is used in IOx and not relevant to Monolith.

* fix: use parquet cache for get_opts requests

* test: that the parquet cache is being hit from write buffer
2025-05-26 14:11:06 -04:00
Trevor Hilton d1c10f4b29
fix: backfill new tags with NULL instead of empty string (#26446)
* fix: backfill new tags with NULL instead of empty string

* refactor: use helper for append_null

* test: add a test to check null back/forward fill
2025-05-21 17:23:51 -04:00
praveen-influx 1ec063b0c4
feat: support named admin tokens (#26434)
* feat: support named admin tokens

- `--name` and `--expiry` are now allowed for `--admin` subcommand
- `--regenerate` is restricted to operator token only
- the endpoint is not allowed if auth is disabled

closes: https://github.com/influxdata/influxdb_pro/issues/854

This is a port of https://github.com/influxdata/influxdb_pro/pull/850 (hash:156981e4a1)

* refactor: address PR feedback
2025-05-20 15:30:19 +01:00
Stuart Carnie bf83e7fbb3
feat: `/ping` API contains versioning headers (#26433)
* feat: `/ping` API contains versioning headers

Further, the product version can be modified by updating the metadata in
the `influxdb3_process` `Cargo.toml`.

* chore: PR feedback

* chore: placate linter
2025-05-20 08:50:27 +10:00
praveen-influx 1f076b69c8
feat: add trigger count to telemetry (#26426)
* feat: add trigger count to telemetry

closes: https://github.com/influxdata/influxdb/issues/26285

* refactor: do trigger counts by type
2025-05-16 17:18:26 +01:00
praveen-influx b404e8475c
fix: do not allow operator token from being deleted (#26418)
* fix: do not allow operator token from being deleted

closes: https://github.com/influxdata/influxdb_pro/issues/819

* refactor: address PR feedback

* fix: add a word and clarifying colon

* fix: failing test

---------

Co-authored-by: Peter Barnett <peter.barnett03@gmail.com>
2025-05-15 09:10:37 +01:00
praveen-influx 8aab3cc607
feat: allow health,ping,metrics to opt out of auth (#26406)
* feat: allow health,ping,metrics to opt out of auth

This commit introduces `--disable-authz <DISABLE_AUTHZ_RESOURCES>`. The
options for `DISABLE_AUTHZ_RESOURCES` are health, ping and metrics. By
default all these resources will be guarded

closes: https://github.com/influxdata/influxdb_pro/issues/774

* chore: update influxdb3/src/commands/helpers.rs

space after comma in help text

Co-authored-by: Trevor Hilton <thilton@influxdata.com>

* chore: update influxdb3/src/help/serve.txt

space after comma in help text

Co-authored-by: Trevor Hilton <thilton@influxdata.com>

* chore: update influxdb3/src/help/serve_all.txt

space after comma in help text

Co-authored-by: Trevor Hilton <thilton@influxdata.com>

* refactor: use statics to reduce clones/copies

---------

Co-authored-by: Trevor Hilton <thilton@influxdata.com>
2025-05-13 15:47:53 +01:00
praveen-influx 8a3d98a273
feat: support `Basic $TOKEN` for all apis (#26363)
* feat: support `Basic $TOKEN` for all apis

closes: https://github.com/influxdata/influxdb/issues/25833

* refactor: address PR feedback to return MalformedRequest error when `:` is used more than once in user-pass pair

* refactor: change the message sent back for malformed auth header
2025-05-09 18:11:37 +01:00
Trevor Hilton 9f66852590
feat: track object store metrics (#26365) 2025-05-08 12:32:12 -04:00
peterbarnett03 f6aa0c1b29
fix: update token creation output (#26336)
* fix: clarify token generation output for easier readibility

* fix: linter error

* fix: additional linter error

* fix: linter error on output

* fix: switch to owo_colorize
2025-04-30 12:11:33 -05:00
praveen-influx 08f2f857da
feat: additional info when started --without-auth (#26338)
- return 405 message body to indicate the endpoints are disabled
- extra log to say server has been started without auth
2025-04-29 08:06:44 -05:00
peterbarnett03 6a6743412a
feat: Remove Last Cache Size Limitation (#26333)
* feat: remove limit on LVC size

* fix: bad test case and incorrect info

* fix: more clarity and default value

* fix: light CLI polishes

* fix: bad snapshot
2025-04-28 13:40:18 -04:00
praveen-influx a3428261a3
feat: add `cluser_uuid`/`catalog_uuid` to telemetry (#26335)
closes: https://github.com/influxdata/influxdb_pro/issues/764
2025-04-28 12:37:37 -05:00
praveen-influx 9c8c7fe105
refactor: port changes from enterprise (#26329) 2025-04-25 18:08:07 +01:00
Trevor Hilton e977d263f8
chore: back-port changes from influxdb_pro#762 (#26323) 2025-04-25 10:02:08 -04:00
Trevor Hilton 85850cd394
feat: improve control of logs on test harness (#26325) 2025-04-24 21:09:00 -04:00
Trevor Hilton 0f52ebb90d
fix: group by tag columns with escape quotes (#26326)
* test: reproducer for #26216
* fix: group by tag columns with escape quotes
2025-04-24 20:31:14 -04:00
Michael Gattozzi fb8daa7860
feat: Add more TLS tests to the test suite (#26324)
* feat: Add a negative cert test

This adds a test that will panic on server startup because connections
to said server are invalid. We add a bad expired cert to our cert
generation for usage in our tests.

Note that this test is only really valid if other tests pass as it
depends on waiting for the server start checks to fail. If other
tests run then their server started fine and so did this one, the
only difference being that connections will error due to a bad tls cert.

Closes #26256

* feat: Add minimum TLS version test

This is a follow on to #26307. In this commit we add a test where we
check that connections only pass if TLS is set to v1.3. The default is
1.2 and other tests connect with that just fine. In this test we spin
up a server using only v1.3 as the minimum and try to connect with v1.2
which we expect to fail and then v1.3 which should pass.

Closes #26308
2025-04-24 18:11:39 -04:00
Stuart Carnie 8507bdc766
fix: Ensure `iox` table schema is sorted for SHOW TABLES (#26302)
* fix: Ensure `iox` table schema is sorted for SHOW TABLES

Closes #25860

* chore: Add insta snapshot

* chore: placate clippy
2025-04-23 09:05:06 +10:00
Stuart Carnie b0532dce87
fix: Consistent thread arguments with influxdb3_pro (#26304)
If the old environment variables are used, a warning will be displayed
on the console with the recommended replacement.
2025-04-23 09:04:32 +10:00
Michael Gattozzi af57abd6a9
feat: Allow setting a minimum TLS version (#26307)
This commit allows users to set a minimum TLS version. The default is
1.2. The choices are TLS 1.2 or TLS 1.3 which can be set via env var:

INFLUXDB3_TLS_MINIMUM_VERSION="tls-1.2"
or
INFLUXDB3_TLS_MINIMUM_VERSION="tls-1.3"

and for the command line flag for the serve command:

--tls-minimum-version tls-1.2

or

--tls-minimum-version tls-1.3

With this users have more fine grained control over what tls version
they require.

Closes #26255
2025-04-22 13:57:23 -04:00
Michael Gattozzi f9721d3355
feat: Generate testing TLS certs on the fly (#26288)
This commit is a follow up to #26246 and generates test certs on the fly
for our test suite. In practice this will only need to be done once with
a fresh repo check out as the certs will expire long after anyone would
reasonably be working on this code in the year 4096! This could be
extended in the future to generate negative tls tests where the file
should be expired.

Closes #26254
2025-04-21 11:43:33 -04:00
praveen-influx b41a2d9bc3
feat: expose `--format json` for token creation cmd (#26286)
* feat: expose `--format json` for token creation cmd

closes: https://github.com/influxdata/influxdb/issues/25913

* refactor: address feedback
2025-04-18 08:06:02 +01:00
peterbarnett03 2ceed952b8
docs: clarify default maxes for distinct cache (#26281) 2025-04-16 15:29:30 -04:00
Trevor Hilton e4cfbf71f7
chore: back-port catalog limit refactor from enterprise (#26278)
This back-ports some changes to how limits are enforced on the catalog
from enterprise. There were some changes that would catch some potential
bugs.
2025-04-16 14:03:24 -04:00
Michael Gattozzi ab13c05c3f
feat: Add env vars for TLS options (#26277) 2025-04-16 12:11:28 -04:00
Stuart Carnie 5da3850319
fix: `--tags` argument is optional and now requires at least one tag (#26275)
* fix: `--tags` argument is optional and now requires at least one tag

Closes #25824

* chore: Added CLI unit tests
2025-04-16 11:46:13 -04:00
Trevor Hilton 78616025b9
chore: fix help text in core (#26267) 2025-04-14 16:54:09 -04:00
Trevor Hilton 847c53ab2d
docs: fix typos in help text (#26266) 2025-04-14 16:11:00 -04:00
praveen-influx f3aa3ecf02
feat: updates to token help message (#26264) 2025-04-14 18:37:21 +01:00
praveen-influx 0cb5f9077c
feat: ask for confirmation when regenerating token (#26258) 2025-04-13 09:07:09 +01:00
Trevor Hilton 5d7cb88f87
feat: track catalog retries as prometheus metric (#26251)
Adds a metric to track total retried catalog operations due to the catalog
being updated elsewhere. Includes a test to check the counter increments
on basic catalog operations.
2025-04-11 15:24:10 -04:00
praveen-influx e5af9f95d2
feat: enable auth by default (#26243)
* feat: enable auth by default

- Removes `--bearer-token` support and starts the server with auth by
  default.
- Adds `--without-auth` switch to start the server without any auth

* feat: changes for auth being turned off

when auth is turned off,
- disallow token endpoints (returns 405)
- remove hash column when querying tokens system table

* refactor: address PR feedback
2025-04-11 16:44:27 +01:00
Trevor Hilton a1923d9304
fix: build after some merge regressions (#26248) 2025-04-10 16:20:11 -04:00
praveen-influx 64eeb09687
feat: allow token deletes (#26247)
This commit allows deletion of tokens by name. Below is an example,

`influxdb3 delete token --token-name _admin --token $CURRENT_ADMIN_TOKEN`

It needs user confirmation before proceeding with the delete
2025-04-10 20:31:19 +01:00
Michael Gattozzi fe69793418
feat: Add TLS support for influxdb3 (#26246)
This commit adds TLS support to influxdb3 and allows users to pass in a
path to a key and cert file with the --tls-key and --tls-cert flags in
the serve command. It also adds the ability for every command to specify
a certificate authority for requests. This is mostly needed when the
cert is self signed, but there are other use cases for this.

The big thing is that most of our tests now use TLS by default. Included
are self signed certs for localhost and the the CA cert included in the
commit. Since these are *only* used for testing this should be fine to
include as they are not used in nor are they intended to be used in any
production system. The expiry has been set for 365 days and the file
perms are set to o600 like the original issue mentioned. The tests pass
with this restriction.

I've verified that the API works via curl with the self signed certs as
I did *not* need to pass in the -k option to bypass checking the certs
were valid. The same goes for our tests. They use the rootCA.pem file
to verify the self signed cert when connecting and reject it otherwise.

With this users can be confident that their queries are safely encrypted
during transport.

Note that TLS works for both FlightSQL and our normal APIs.

Closes #25774
2025-04-10 13:45:47 -04:00
Michael Gattozzi f7feaacc99
feat: Change help messages for influxdb3 and serve (#26235)
This changes the help messages for the serve command and the influxdb3
top level help output. This is to provide better help output and options
for users compared to the clap defaults. After many iterations this code
was the final design I landed on. In order to make our custom help work
we:

1. Roughly parse the args to check for a given command and help message
2. If there is no subcommand we print out our custom help message for
   the top level command
3. If there is a subcommand we only print it out for serve currently
4. --help-all prints a more detailed message

This lets us upgrade our help messages in place over time as the
subcommands themselves have subcommands that also need their own help
messages. For now we only include these two.

We could not use something like `clap-help` or derive the output from
the derived clap struct automatically due to multiple issues, but
suffice to say the main thing was that we could not parse the args into
the `Config` struct and then figure out our help message and `clap`'s
message template function was too underpowered. We also wanted to create
a `help-all` flag and this was quite hard to make work with `clap`'s
short and long help.

In the end the best option was to roll our own. While a bit hacky in
terms of us maintaining it, the overall outcome should be a much nicer
user experience in which they can have much better introductions to the
tool. `serve` was quite egregious with a lot of output and very little
actionable options to use for most users.

Closes #26201
2025-04-09 14:25:16 -04:00
praveen-influx 1983818e36
feat: porting token work from enterprise (#26239)
* feat: generate persistable admin token

- this commit allows admin token creation using `influxdb3 create token
  --admin` and also allows regeneration of admin token by `influxdb3
  create token --admin --regenerate`
- `influxdb3_authz` crate hosts all low level token types and behaviour
- catalog log and snapshot types updated to use the token repo
- tests that relied on auth have been updated to use the new token
  generation mechanism and new admin token generation/regeneration tests
  have been added

* feat: list admin tokens

- allows listing admin tokens
- uses _internal db for token system table
- mostly test fixes due to _internal db
2025-04-09 16:31:59 +01:00
Trevor Hilton 1dd8cccbdd
feat: catalog updates state to stopped on shutdown (#26241) 2025-04-09 10:56:10 -04:00
Trevor Hilton b472e14625
test: check error behaviour on create table api (#26233)
Added an integration test that verifies that invalid field types produce
an error instead of leading to a panic.
2025-04-07 14:14:21 -04:00
Trevor Hilton c7854363c4
chore: back-port changes to shutdown code from enterprise (#26206)
* refactor: make ShutdownManager Clone

ShutdownManager can be clone since its underlying types from tokio are
all shareable via clone.

* refactor: make ShutdownToken not Clone

Alters the API so that the ShutdownToken is not cloneable. This will help
ensure that the Drop implementation is invoked from the correct place.
2025-04-01 11:32:23 -04:00
Jackson Newhouse d245b2e886
fix(processing_engine): properly extract data from DictionaryArrays (#26204) 2025-03-31 11:38:23 -07:00
Trevor Hilton a8e12803b0
fix: additional check on frontend shutdown (#26205)
Added an additional check in the serve command to ensure that the frontend
has shutdown before exiting so that we don't close any connections pre-
emptively.
2025-03-31 13:59:47 -04:00
Trevor Hilton 24887770ef
feat: shutdown on WAL overwritten (#26203)
* feat: trigger shutdown if wal has been overwritten

WAL persist uses PutMode::Create in order to invoke shutdown if another
process writes to the WAL ahead of it.

A test was added to check that it works from CLI test suite.

* chore: clippy
2025-03-31 12:58:18 -04:00
Trevor Hilton eda2fc9b21
refactor: ensure shutdown complete via Drop impl (#26202)
This ensures a ShutdownToken will invoke `complete` by calling it from
its `Drop` implementation. This means registered components are not
required to signal completion, but can if needed.

Some comments and other cleanup refactoring was done as well.
2025-03-31 10:25:55 -04:00
Trevor Hilton 9401137825
feat: handle graceful shutdown (#26197)
* feat: add influxdb3_shutdown crate

provides basic wait methods for unix/windows OS's

* feat: graceful shutdown

* docs: add rust docs and test to influxdb3_shutdown

Added rustdoc comments to types and methods in the influxdb3_shutdown
crate as well as a test that shows the ordering of a shutdown.
2025-03-31 09:58:40 -04:00
Jackson Newhouse 7c02593fef
chore: Overhaul CLI tests for better ergonomics. (#26168)
* chore: Overhaul CLI tests for better ergonomics.

* chore: switch with_query() to with_sql().
2025-03-20 09:19:12 -07:00
Trevor Hilton d2da058ded
chore: cleanup token create CLI message (#26158) 2025-03-18 10:08:16 -04:00
Trevor Hilton 863a6d0b4a
feat: ack catalog update broadcast (#26118)
This creates a CatalogUpdateMessage type that is used to send
CatalogUpdates; this type performs the send on the oneshot Sender so
that the consumer of the message does not need to do so.

Subscribers to the catalog get a CatalogSubscription, which uses the
CatalogUpdateMessage type to ACK the message broadcast from the catalog.

This means that catalog message broadcast can fail, but this commit does
not provide any means of rolling back a catalog update.

A test was added to check that it works.
2025-03-17 20:20:07 -04:00
Trevor Hilton 3ad0670452
test: small change to distinct cache cli test (#26152)
Added one check to the distinct cache create test that checks duplicate
creation behaviour while investigating influxdb_pro#601
2025-03-17 11:05:25 -04:00