Commit Graph

49650 Commits (hiltontj/help-fixes-2)

Author SHA1 Message Date
Trevor Hilton 6bf1ad9230 chore: fix help text in core 2025-04-14 16:34:32 -04:00
Trevor Hilton 847c53ab2d
docs: fix typos in help text (#26266) 2025-04-14 16:11:00 -04:00
Trevor Hilton 2b2899f60f
chore: back-port changes from enterprise (#26265) 2025-04-14 14:47:20 -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
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
Paul Dix 26728028df
feat: limit tag columns per table to 250 (#26249) 2025-04-10 17:38:07 -04: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
Jamie Strandboge 37e2981ce2
fix(install_influxdb.sh): use 'shasum -a 256' on OSX (#26245)
sha256sum is present on some versions of OSX, but not all. Use
'shasum -a 256' on OSX since it should always be present.
2025-04-09 17:05:16 -05: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
Jamie Strandboge 11e4433852
fix: update install_influxdb.sh for core rename and download releases (#26242)
* fix: update install_influxdb.sh for core rename and download releases

* chore(install_influxdb.sh): make shellcheck clean
2025-04-09 10:26:40 -05: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 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 08a4aa0be3
chore: update tokio to 1.43.1 for RUSTSEC (#26234) 2025-04-07 13:12:48 -04: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
Jamie Strandboge d8ce7f93dc
fix: rename influxdb3 to influxdb3-core when building packages (#26220) 2025-04-03 11:50:46 -05:00
Jamie Strandboge 6a947bfc35
fix(ci): update ci-support to add _<arch> to zip filename (#26212) 2025-04-02 14:47:39 -05:00
Trevor Hilton 6a3767fb45
refactor: split existence check to two method in Repository (#26214) 2025-04-02 14:20:43 -04:00
Jackson Newhouse f881c5844b
chore: remove generic term from HttpApi (#26210) 2025-04-01 10:17:56 -07: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
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
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
Trevor Hilton 87a54814ae
chore: cleanup tracing from cache crate (#26194) 2025-03-27 07:16:37 -04:00
Jackson Newhouse 033e1176d8
fix: correctly handle multiple empty batches in JSON format results. (#26192) 2025-03-25 13:13:05 -07:00
praveen-influx 0df72a4d88
chore: release beta 2 (#26187) 2025-03-24 21:10:46 +00:00
Trevor Hilton f5144b88a8
feat: version 2 catalog serialization (#26183)
This introduces a new version for the catalog file formats ([snapshot](3b57682214/influxdb3_catalog/src/snapshot/versions/mod.rs (L2)) files and [log](3b57682214/influxdb3_catalog/src/log/versions/mod.rs (L2)) files). The reason for introducing a new version is to change the serialization/deserialization format from [`bitcode`](https://docs.rs/bitcode/latest/bitcode/) to JSON. See #26180.

The approach taken was to copy the existing type definitions for both log and snapshot files into two places: a `v1` module and a `v2` module. Going forward:
* Types defined in `v1` should not be changed. They are only there to enable deserialization of existing bitcode-serialized catalog files. 
* Types defined in `v2` can be modified in a backward-compatible manor, and new types can be added to the `v2` modules

With this PR, old files are not overwritten. The server does not migrate any files on startup. See https://github.com/influxdata/influxdb/pull/26183#issuecomment-2748238191

Closes #26180
2025-03-24 12:41:00 -04:00
wayne f456fd4df3
feat: add BooleanValue::Toggle and FloatValue::SequentialWithInc (#26178) 2025-03-21 09:55:22 -06:00
praveen-influx d6abd8db66
chore: create release doc (#26171) 2025-03-20 20:06:28 +00:00
praveen-influx 823e792c67
chore: check if build is dirty and fail (#26172) 2025-03-20 20:05:32 +00:00
wayne 4fd0a3b05d
feat: support deterministic load generator values (#26174)
* simplify FieldValue types by making load generator functions should be
  generic over RngCore and passing the RNG in to methods rather than
  depending on it being available on every type instance that needs it
* expose influxdb3_load_generator as library crate
* export config, spec, and measurement types publicly to suppore use in
  the antithesis-e2e crate
* fix bug that surfaced whenever the cardinality value was less than the
  lines per sample value by forcing LP lines in a set of samples to be
  distinct from one another with nanosecond increments
2025-03-20 11:58:38 -06: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
praveen-influx 98bf325a46
chore: 3.0.0-beta.1 release ready (#26167) 2025-03-19 22:24:32 +00:00
Jamie Strandboge 8bb09e4b82
chore(ci): update to handle release tags (#26166)
* chore(ci): use most recent ci-support images

* fix: update release_filter (thanks Praveen) and pkg version for release
2025-03-19 10:46:44 -05:00
Michael Gattozzi b792f70960
fix: maybe fix flakiness for parquet cache test (#26159)
This adds a sleep so that the parquet cache has a little bit of time to
populate before we make another request to the query buffer. Sometimes
it does not populate and so we have a race condition where the new
request comes in and actually goes to object store. This is fine in
practice because it would also take time to fill the cache in production
as well. I haven't really seen the test fail since adding this, but
triggering it in the first place is really hard and in practice does not
happen all that often.
2025-03-18 11:31:30 -04:00
Michael Gattozzi 4e2cb630b3
fix: Prevent Catalog UUID races for new nodes (#26160)
When starting up a new cluster in Enterprise we might have multiple
nodes starting at the same time. We might have an issue wherby we have
multiple catalogs with different UUIDs in their in memory
representation.

For example:
- Let's say we have node0 and node1
- node0 and node1 start at the same time and both check object storage
  to see if there is a catalog to load
- They both see there is no catalog
- They both create a new one by generating a UUID and persisting it to
  object storage
- Whichever is written second is now the one with the correct UUID in
  their in memory representation while the other will not have the
  correct one until restarted likely

This in practice isn't an issue today as Trevor notes in
https://github.com/influxdata/influxdb_pro/issues/600, but it could be
once we start using `--cluster-id` for licensing purposes. In order to
prevent this we instead make the write to object storage use the Put
mode. If it exists then the write will fail and the node that lost the
race will instead just load the other's catalog.

For example if node1 wins the race then node0 will load the catalog
created by node1 and use that UUID instead.

As this is hard to create a test for as it involves a race condition to
happen I have not included one as we could never really be sure it was
taken care of and we rely on the underlying object store we are writing
to to handle this for us. It's also not likely to happen given this is
only on a new cluster being initiated for the first time decreasing the
chances of it occurring in the first place.
2025-03-18 11:25:08 -04: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
peterbarnett03 98ca8dcb50
chore: Update install script for Docker with cluster changes (#26149)
* chore: update Docker install info

* fix: remove secondary script

* fix: bad copy

* fix: tiny bad copy

* fix: revert issue

* fix: adjust for Core

* fix: removing MUSL and fixing fi

* chore: whitespace updates for previous commits

---------

Co-authored-by: Jamie Strandboge <jamie@influxdata.com>
2025-03-17 14:45:34 -05:00