Commit Graph

2791 Commits (3.0)

Author SHA1 Message Date
Paul Dix d7c071e0c4
chore: version bump for 3.0.1 (#26282) 2025-04-16 15:48:59 -04:00
Paul Dix 3b602eead2
chore: version bump to release 3.0 (#26268) 2025-04-14 18:15:17 -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
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
praveen-influx 38e3dad907
chore: update crossbeam-channel, fixes cargo-audit failure (#26240) 2025-04-09 14:46:08 +01:00
praveen-influx 2e1f7ad9cb
chore: beta 4 release version bump (#26236) 2025-04-08 14:54:41 +01:00
Trevor Hilton 08a4aa0be3
chore: update tokio to 1.43.1 for RUSTSEC (#26234) 2025-04-07 13:12:48 -04:00
praveen-influx d0ae82c54b
chore: version bump for beta 3 release (#26208) 2025-04-01 16:31:47 +01: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
praveen-influx 0df72a4d88
chore: release beta 2 (#26187) 2025-03-24 21:10:46 +00:00
praveen-influx 98bf325a46
chore: 3.0.0-beta.1 release ready (#26167) 2025-03-19 22:24:32 +00: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 a455598be6
feat(processing_engine): Implement Processing Engine Cache. (#26111) 2025-03-11 15:48:47 -07:00
Trevor Hilton 503819468e
feat: catalog checkpoints (#26126) 2025-03-11 18:20:36 -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
praveen-influx 5fda7277e7
chore: fix cargo audit failures (#26112)
- update ring (ring v0.17.8 -> v0.17.13)
- added paste crate (unmaintained) to ignore list
2025-03-10 13:26:33 +00:00
Michael Gattozzi 329ef2f11b
feat: allow new tags in schema again (#26108)
This commit restores the old behavior we had where new tags can be added
to a schema. To do this we made tags nullable and brings us in line with
our other products. These changes were made in this PR:

https://github.com/influxdata/influxdb3_core/pull/41.

Changes to accomplish this new behavior were:

- Queries now do not return an empty string for null tags instead they
  are returned as null, or in many formats not at all.
- References to v1 for parsing and validating lines were removed as we
  only have one path for doing so these days shared amongst all the
  write_lp endpoints.
- We fixed failing tests that expected us to not be able to have new
  tags or depended on that functionality indirectly
- Tests had their snapshot files updated to reflect that tags are
  nullable by default
- Behavior for making a schema and checking whether a column can be null
  were updated in a separate repo and integrated here
- The series_key is updated whenever we get a new tag added to the
  schema
- New tests were added to show that you can add a new tag and that the
  series key is updated as part of that

With the above changes we can now allow tags to be added again by users
like they would expect, especially with v1 and v2 apis and Telegraf
plugins.
2025-03-06 13:59:15 -05: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
wayne a84c4a9a8b
fix: ensure "local" ObjectStore.list returns ordered elements (#26081) 2025-02-28 10:46:44 -07:00
Jackson Newhouse b0a24220c0
feat(processing_engine): Allow async plugin execution. (#25994) 2025-02-13 09:08:19 -08:00
Trevor Hilton 9646691d96
fix: serialize distinct cache in catalog (#25990)
The distinct cache info for tables was not serialized in the catalog.
This fixes it, but also updates the catalog serialization to use the
snapshot type serialization from the Catalog type all the way down.

The Eq and PartialEq impls were removed from Catalog and InnerCatalog
as they were only used in tests, and wer replaced by pure insta snapshot
tests.

A test was added to check that the distinct cache serializes/deserializes
2025-02-11 11:04:31 -05: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 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
Trevor Hilton 23b77946f4
refactor: remove buffer index and literal guarantee analysus in filter (#25949)
This removes the buffer index from the write buffer in core and lifts the
literal guarantee analysis from the ChunkFilter.
2025-01-31 14:43:10 -05: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
praveen-influx 4ef972eab4
feat: first stab at locally updating parquet cache (#25904)
* feat: first stab at locally updating parquet cache

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

* refactor: use enums to separate out the modes

This commit introduced the `Immediate` and `Eventual` modes for
fulfilling the cache request. In immediate mode since the data is
readily available to be cached, we can avoid extra requests to object
store.

part of: https://github.com/influxdata/influxdb/issues/25887
2025-01-24 14:36:06 +00:00
Jackson Newhouse f1ea2d8747
feat(processing_engine): Add every mode for scheduled plugins. (#25891) 2025-01-23 11:22:57 -08:00
Paul Dix e87f8862b3
feat: Add request plugin capability (#25864)
* feat: Add request plugin capability

Adds the request plugin type. Triggers can be bound to an API endpoint at /api/v3/engine/<path>. Requests will get yielded to the plugin with the query parameters, request parameters, and request body.

I didn't implement the test endpoint for this plugin type as it seems much more natural for users to save the file and make a new request. Once #25863 is done it'll make it very easy.

Closes #25862

* chore: fix spelling in error message
2025-01-21 20:22:27 -08:00
Trevor Hilton d1fd155b21
feat: use u64 hash in buffer index instead of str literal (#25883)
* feat: use u64 hash in buffer index instead of str literal

* refactor: move hash of column after if branch and add docs
2025-01-21 09:09:25 -05:00
Jackson Newhouse 1d8d3d66fc
feat(processing_engine): Add cron plugins and triggers to the processing engine. (#25852)
* feat(processing_engine): Add cron plugins and triggers to the processing engine.

* feat(processing_engine): switch from 'cron plugin' to 'schedule plugin', use TimeProvider.

* feat(processing_engine): add test for test scheduled plugin.
2025-01-18 07:18:18 -05:00
Paul Dix b39b48a2cf
feat: load plugins from our github plugin repo (#25861)
Adds the ability to load a plugin from our public github repo here: https://github.com/influxdata/influxdb3_pluginshttps://github.com/influxdata/influxdb3_plugins

If the plugin filename is specified as `gh:examples/wal_plugin` it will pull from the github repo at `<dir>/<name>/<name>.py`.

Closes #25836
2025-01-17 15:44:42 -05:00
Trevor Hilton 8ea6d65f8e
chore: bring back enterprise changes (#25858) 2025-01-17 13:24:32 -05:00
Paul Dix 1f71750bfe
feat: return better plugin execution errors (#25842)
* feat: return better plugin execution errors

This sets up the framework for fleshing out more useful plugin execution errors that get returned to the user during testing. We'll also want to capture these for logging in system tables.

Also fixes a test that was broken in previous commit on time limits. Didn't show up because of the feature flag.

* fix: compile errors without system-py feature
2025-01-16 15:58:05 -05:00
Trevor Hilton b8a94488b5
feat: support v1 query API GROUP BY semantics (#25845)
This updates the v1 /query API hanlder to handle InfluxDB v1's unique
query response structure when GROUP BY clauses are provided.

The distinction is in the addition of a "tags" field to the emitted series
data that contains a map of the GROUP BY tags along with their distinct
values associated with the data in the "values" field.

This required splitting the QueryExecutor into two query paths for InfluxQL
and SQL, as this allowed for handling InfluxQL query parsing in advance
of query planning.

A set of snapshot tests were added to check that it all works.
2025-01-16 11:59:01 -05:00
Paul Dix 4bfd95d068
feat: print plugin logs to the server (#25812) 2025-01-12 12:33:09 -05:00
Paul Dix 491a37b0d4
feat: Update create plugin to use server file (#25803)
This updates the create plugin API and CLI so that it doesn't take the pugin code, but instead takes a file name of a file that must be in the plugin-dir of the server. It returns an error if the plugin-dir is not configured or if the file isn't there.

Also updates the WAL and catalog so that it doesn't store the plugin code directly. The code is read from disk one time when the plugin runs.

Closes #25797
2025-01-11 21:02:51 -05:00
Trevor Hilton 0bdc2fa953
chore: patch enterprise back to core (#25798) 2025-01-11 17:26:41 -05:00
Paul Dix e8422a240a
feat: Wire up arguments to wal plugin trigger (#25783)
This allows the user to specify arguments that will be passed to each execution of a wal plugin trigger. The CLI test was updated to check this end to end.

Closes #25655
2025-01-10 16:58:18 -05:00
Paul Dix 7230148b58
feat: Update WAL plugin for new structure (#25777)
* feat: Update WAL plugin for new structure

This ended up being a very large change set. In order to get around circular dependencies, the processing engine had to be moved into its own crate, which I think is ultimately much cleaner.

Unfortunately, this required changing a ton of things. There's more testing and things to add on to this, but I think it's important to get this through and build on it.

Importantly, the processing engine no longer resides inside the write buffer. Instead, it is attached to the HTTP server. It is now able to take a query executor, write buffer, and WAL so that the full range of functionality of the server can be exposed to the plugin API.

There are a bunch of system-py feature flags littered everywhere, which I'm hoping we can remove soon.

* refactor: PR feedback
2025-01-10 05:52:33 -05:00
Paul Dix 2d18a61949
feat: Add query API to Python plugins (#25766)
This ended up being a couple things rolled into one. In order to add a query API to the Python plugin, I had to pull the QueryExecutor trait out of server into a place so that the python crate could use it.

This implements the query API, but also fixes up the WAL plugin test CLI a bit. I've added a test in the CLI section so that it shows end-to-end operation of the WAL plugin test API and exercise of the entire Plugin API.

Closes #25757
2025-01-09 20:13:20 -05:00
praveen-influx 6e2e39cd4c
feat: snapshot when wal buffer is empty (#25765)
* feat: snapshot when wal buffer is empty

- This commit changes the functionality to allow snapshots to happen even when
  wal buffer is empty. For snapshots wal periods are still required but
  not the wal buffer. To allow this, we write a no-op into wal file with
  snapshot details. This enables force snapshotting functionality

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

* refactor: address PR feedback
2025-01-09 12:12:37 +00:00
Trevor Hilton dfc853d903
feat: handle params in request body for /query API (#25762)
Closes #25749

This changes the `/query` API handler so that the parameters can be passed in either the request URI or in the request body for either a `GET` or `POST` request.

Parameters can be specified in the URI, the body, or both; if they are specified in both places, those in the body will take precedent.

Error variants in the HTTP server code related to missing request parameters were updated to return `400` status.
2025-01-07 19:53:29 -05:00
Michael Gattozzi f793d31f63
feat: Cleanup CLI flags for InfluxDB 3 Core (#25737)
This makes quite a few major changes to our CLI and how users interact
with it:

1. All commands are now in the form <verb> <noun> this was to make the
   commands consistent. We had last-cache as a noun, but serve as a
   verb in the top level. Given that we could only create or delete
   All noun based commands have been move under a create and delete
   command
2. --host short form is now -H not -h which is reassigned to -h/--help
   for shorter help text and is in line with what users would expect
   for a CLI
3. Only the needed items from clap_blocks have been moved into
   `influxdb3_clap_blocks` and any IOx specific references were changed
   to InfluxDB 3 specific ones
4. References to InfluxDB 3.0 OSS have been changed to InfluxDB 3 Core
   in our CLI tools
5. --dbname has been changed to --database to be consistent with --table
   in many commands. The short -d flag still remains. In the create/
   delete command for the database however the name of the database is
   a positional arg

   e.g. `influxbd3 create database foo` rather than
        `influxdb3 database create --dbname foo`
6. --table has been removed from the delete/create command for tables
   and is now a positional arg much like database
7. clap_blocks was removed as dependency to avoid having IOx specific
   env vars
8. --cache-name is now an optional positional arg for last_cache and meta_cache
9. last-cache/meta-cache commands are now last_cache and meta_cache respectively

Unfortunately we have quite a few options to run the software and I
couldn't cut down on them, but at least with this commands and options
will be more discoverable and we have full control over our CLI options
now.

Closes #25646
2025-01-06 18:51:55 -05:00
Paul Dix 1ce6a24c3f
feat: Implement WAL plugin test API (#25704)
* feat: Implement WAL plugin test API

This implements the WAL plugin test API. It also introduces a new API for the Python plugins to be called, get their data, and call back into the database server.

There are some things that I'll want to address in follow on work:
* CLI tests, but will wait on #25737 to land for a refactor of the CLI here
* Would be better to hook the Python logging to call back into the plugin return state like here: https://pyo3.rs/v0.23.3/ecosystem/logging.html#the-python-to-rust-direction
* We should only load the LineBuilder interface once in a module, rather than on every execution of a WAL plugin
* More tests all around

But I want to get this in so that the actual plugin and trigger system can get udated to build around this model.

* refactor: PR feedback
2025-01-06 17:32:17 -05:00