Commit Graph

199 Commits (peterbarnett/update-script-to-three-oh-three)

Author SHA1 Message Date
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 a2dc597d54
chore: update rust toolchain to 1.86.0 (#26355) 2025-05-05 17:33:26 -04: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
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 e684fc1a24
feat: Add support for CORS requests from a browser (#26314)
This commit adds support for CORS by modifying our requests to make
preflight checks valid and to handle responses containing the necessary
headers for browsers to access the data they need. We keep what we
accept as open as this is essentially what requests to the server are
normally like and we gate the requests with an auth token.

Closes #26313
2025-04-24 15:16:18 -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
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
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
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
Trevor Hilton b11cf81dc6
refactor: remove Option from catalog update APIs (#26250)
Catalog update APIs were returning an Option that was not necessary. It
was always Some, so this removes the Option from the API to make the
intent clear - if there is an update made by the requested change, there
is a Batch; whereas if the requested change is erroneous, or would not
produce a change, the response is Err.
2025-04-11 12:34:18 -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
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
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 7d95c48ecf
fix: empty writes do not corrupt wal (#26223)
* test: reproducer for empty write issue

* fix: empty writes do not corrupt wal
2025-04-05 16:44:34 -04:00
Jackson Newhouse f881c5844b
chore: remove generic term from HttpApi (#26210) 2025-04-01 10:17:56 -07:00
praveen-influx e653f736d9
chore: couple of updates to fix cargo audit job (#26209)
* chore: couple of updates to fix cargo audit job

- remove humantime ignore in deny.toml
- update pyo3 to use 0.24.1 (https://rustsec.org/advisories/RUSTSEC-2025-0020.html)

* chore: moved pyo3 version to root cargo.toml
2025-04-01 15:36:01 +01: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 033e1176d8
fix: correctly handle multiple empty batches in JSON format results. (#26192) 2025-03-25 13:13:05 -07: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 0c8d17fb89
refactor: use repositories in catalog (#26135)
* refactor: use repository in catalog

The catalog was refactored to use identifiers on everything, and store
everything in a consistent structure. This structure makes use of the
`Repository` type that holds a `SerdeVecMap` of Id to Resource, along
with the next Id, and a bi-map of Id to resource name.

The `Repository` type is used at each level of the catalog where a
resource is stored.

This simplified repeated logic for snapshot'ing, insert and update of
resources in the catalog, as well as accessor methods for getting by id
or name, and mapping names to ids and vice-versa.

In addition, the process for catalog batch verification and permit was
altered so that the permit process induces a retry if the catalog was
updated while the catalog batch function was producing the batch, i.e, if
the catalog sequence incremented while the caller was waiting for a permit.
This eliminated the need for verifying the catalog batch after it had been
generated, and allows for a single path to apply a catalog batch after it
has been persisted to object store.

This assumes that the generation of the catalog batch implies validity.

Irelevant tests were removed.

Last and Distinct cache's now rely more heavily on Ids, though the proc-
essing engine still needs to switch over to use Ids for starting/stopping
triggers.
2025-03-13 22:42:18 -04:00
Jackson Newhouse 331f88533c
feat(processing_engine): Attach a node id to the processing engine and triggers for multi-node support compatibility. (#26136) 2025-03-13 16:10:02 -07:00
Michael Gattozzi 97b8c471f8
fix: Make sure JSON fully closes on empty records (#26130) 2025-03-12 14:01:40 -04:00
Trevor Hilton 72dc4458fd
chore: backport changes to catalog from enterprise (#26116)
* chore: backport changes to influxdb3_catalog crate

* chore: backport changes to influxdb3_cache crate

* chore: backport changes to influxdb3_write crate

* chore: backport changes to influxdb3_proc_eng crate

* chore: backport influxdb3 crate changes for catalog

* chore: backport changes to influxdb3_id crate

* chore: backport changes to influxdb3_wal crate

* chore: backport changes to influxdb3_clap_blocks crate

* chore: backport changes to influxdb3_client crate

* chore: backport influxdb3_server crate changes

* chore: fix after full backport

* fix: ordering of catalog broadcast
2025-03-11 12:11:51 -04:00
Jackson Newhouse 5fa417c3f0
feat: remove system-py (#26087)
* feat: remove system-py

* chore: allow Apache-2.0 WITH LLVM-exception license.
2025-03-10 11:10:33 -07:00
praveen-influx c724e06e3f
feat: query path instrumentation (#26106)
- spans added for buffer, parquet chunks along with number of files that
  are already in parquet cache along with the sql
2025-03-06 17:24:34 +00:00
Jackson Newhouse c930d9eef8
feat(processing_engine): error handling for triggers. (#26086) 2025-03-04 09:32:58 -08:00
Michael Gattozzi 1f72bfcc33
feat: Update to Rust 1.85 and 2024 Edition (#26046) 2025-02-20 14:58:07 -05:00
wayne 8daccb7ee8
fix: add SpanContext with TraceCollector to query_sql call (#26006) 2025-02-13 18:43:25 -07:00
Jackson Newhouse b0a24220c0
feat(processing_engine): Allow async plugin execution. (#25994) 2025-02-13 09:08:19 -08:00
Michael Gattozzi cf1dd5c831
fix: broken format for JSON queries and add tests (#25980)
In #25927 we missed that JSON queries were broken despite having some
tests use the format. This fixes JSON queries such that they now
properly contain a comma between RecordBatches. This commit also
includes tests for the formats that now stream data back (CSV, JSON, and
JSON Lines) so that we won't run into this issue again.
2025-02-06 20:25:18 -05:00
Trevor Hilton 1ac67a3ca1
fix: remove request uri from error log (#25981) 2025-02-06 14:47:22 -05:00
praveen-influx 6ca3411862
chore: remove log line (#25976) 2025-02-05 22:23:46 +00:00
praveen-influx fa69045f5b
chore: fixes for the build (#25973)
- missing clone/copy impl for NoProcessingEngine
- scope the visibility of a method
2025-02-05 17:44:24 +00:00
Jackson Newhouse fbcb9403c4
feat(processing_engine): log processing engine logging calls to sys events. (#25939) 2025-02-04 15:16:04 -08:00
wayne fa18b6d8da
refactor: DRY up influxdb3_client code (#25962)
* deduplicate QueryParams->QueryRequest and Format->QueryFormat
* move WriteParams into influxdb3_types crate
* DRY up client HTTP request handling code in *RequestBuilder.send
  methods.
* DRY up a bunch of other non-Builder http request handling
2025-02-04 08:54:37 -07:00
wayne 27653f5a76
fix: enable workspace lints on all crates, fix all lints (#25961) 2025-02-03 17:38:20 -07:00
wayne ca25ab6f70
fix: remove accidentally-commited dbg! macro (#25958) 2025-02-03 15:48:35 -07:00
wayne 0fffcc8c37
refactor: introduce influxdb3_types crate (#25946)
Partially fixes https://github.com/influxdata/influxdb/issues/24672

* move most HTTP req/resp types into `influxdb3_types` crate
* removes the use of locally-scoped request type structs from the `influxdb3_client` crate
* fix plugin dependency/package install bug
  * it looks like the `DELETE` http method was being used where `POST` was expected for `/api/v3/configure/plugin_environment/install_packages` and `/api/v3/configure/plugin_environment/install_requirements`
2025-02-03 11:28:47 -07:00
Michael Gattozzi 20fdc7b51b
feat: stream data back for CSV and JSON queries (#25927)
This commit allows us to stream data back for CSV and JSON formatted
queries. Prior to this we would buffer up all of the data in memory
before sending it back. Now we can make it so that we only buffer in
one RecordBatch at a time to reduce memory overhead.

Note that due to the way the APIs for writers work and for how Body in
hyper 0.14 works we can't use a streaming body that we can write too.
This in turn means we have to use a manually written Future state
machine, which works but is far from ideal.

Note this does not include the pretty and parquet files as streamable.
I'm attempting to get the pretty one to be streamable, but I don't think
that this one and parquet are as likely to be streamable back to the
user. In general we might want to discourage these formats from being
used.
2025-01-31 13:25:30 -05:00
wayne 05da40fa9b
fix: clarify table creation conflict error message (#25936)
Also include a basic CLI integration test to exemplify the new error message.
2025-01-30 13:08:35 -07:00
Jackson Newhouse 8840d99e9d
feat(processing_engine): integration with virtual environments. (#25895)
* feat(processing_engine): integration with virtual environments.

* feat: Initial scaffolding for environment managers (pip, pipx, uv).

* feat(processing_engine): CLI for package management, remove pipx support.

* feat(processing_engine): test installations in virtualenvs.

* feat(processing_engine): Automatically setup virtual environment on startup.
2025-01-28 15:30:17 -08:00
Paul Dix 9a5424693c
feat: Update trigger creation to validate plugin file present (#25918)
This updates trigger creation to load the plugin file before creating the trigger.

Another small change is to make Github references use filenames and paths identical to what they would be in the plugin-dir. This makes it a little easier to have the plugins repo local and develop against it and then be able to reference the same file later with gh: once it's up on the repo.
2025-01-27 12:31:49 -05:00
Paul Dix d49276a7fb
feat: Refactor plugins to only require creating trigger (#25914)
This refactors plugins and triggers so that plugins no longer need to be "created". Since plugins exist in either the configured local directory or on the Github repo, a user now only needs to create a trigger and reference the plugin filename.

Closes #25876
2025-01-27 11:26:46 -05:00