Commit Graph

9680 Commits (5f7a6e696fcabd3395024cdd92b0a76a85653876)

Author SHA1 Message Date
Marco Neumann 5f7a6e696f
refactor: chunk InfluxRPC `ReadResponses` (#6094)
Currently we see some prod panics:

```
'assertion failed: len <= std::u32::MAX as usize', tonic/src/codec/encode.rs:127:5
```

This is due to an upstream bug in tonic:
https://github.com/hyperium/tonic/issues/1141

However the fix will only turn this into an error instead of panicking.
We should instead NOT return such overlarge results, esp. because
InfluxRPC supports streaming.

While we currently don't perform streaming conversion (like streaming
the data out of the query stack into the gRPC layer), the 4GB size limit
can easily be triggered (in prod) w/ enough RAM. So let's re-chunk our
in-memory responses so that they stream nicely to the client.

We may later implement proper streaming conversion, see #4445 and #503.
2022-11-10 08:13:22 +00:00
Andrew Lamb 07c25335cf
chore: delete dead code `PartitionAddr` (#6101) 2022-11-09 21:31:14 +00:00
kodiakhq[bot] fc41013e6b
Merge pull request #6074 from influxdata/cn/upgrade-rust
chore: Upgrade to Rust 1.65
2022-11-09 16:01:04 +00:00
Carol (Nichols || Goulding) dd013c5402
fix: Update the expected size in a test
I tracked down the source of the size difference to the difference in
`mem::size_of::<mutable_batch::column::ColumnData>`. I believe this enum
is now able to take advantage of this niche-filling optimization:

<https://github.com/rust-lang/rust/pull/94075/>
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) abcbe19966
fix: Box some Error type fields to make the Error types small
As found by this new Clippy lint:

<https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err>
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) f33e367904
fix: Use is_none instead of == None, thanks Clippy!
Again seems kinda niche and not a huge deal, but apparently this doesn't
rely on `T: PartialEq` so probably good?

<https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none>
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) 4ab506dbd4
fix: Collapse consecutive replace calls that can be one
Well this is rather niche but it seems good!

<https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace>
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) 43687a86d2
fix: Remove lots of needless borrows that Clippy can now identify
Except for in generated code that we don't control.
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) fa46951524
fix: Remove needless deref done by auto deref, thanks Clippy! 2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) 5d9d1d9ee5
fix: Allow using an if to turn a boolean into 1 or 0
I'm not sure I agree with this clippy lint; I think the `if` is much
clearer

<https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if>
2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) 07505c8f72
fix: Remove needless borrows, thanks Clippy! 2022-11-09 10:54:18 -05:00
Carol (Nichols || Goulding) a3bee0c303
chore: Upgrade to Rust 1.65 2022-11-09 10:29:13 -05:00
Nga Tran 9fe7a50129
feat: call soft delete partitions from garbage collector (#6090) 2022-11-09 14:48:26 +00:00
Nga Tran 77a2541172
feat: flag partitions for delete (#6075)
* feat: flag partition for delete

* fix: compare the right date and time

* chore: Run cargo hakari tasks

* chore: cleanup

* fix: typos

* chore: rust style tidy ups in catalog

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: Luke Bond <luke.n.bond@gmail.com>
2022-11-09 12:06:23 +00:00
Dom d9c97795fc
feat: use IDs in ingester query API (#6093)
* refactor: NS+table ID (instead of name) in querier<>ingester

* feat(ingester): use IDs for query API

Changes the ingester to utilise the ID fields (instead of names) sent
over the query wire message wrapped within the Flight API.

BREAKING: this changes the "query-ingester" CLI command arguments which
now expects the namespace & table IDs, rather than their names.

* refactor(ingester): add more query logging context

Updates the log messages during query execution to include more context
fields.

* style: remove unused import

Co-authored-by: Marco Neumann <marco@crepererum.net>
2022-11-09 11:25:13 +00:00
Jake Goulding c0fcd5e32a
test: Ensure router's HTTP error messages are stable (#6006)
* test: Ensure router's HTTP error messages are stable

If you change the text of an error, the tests will fail.

If you add a new error variant to the `Error` enum but don't add it to
the test, test compilation will fail with a "non-exhaustive patterns"
message.

If you remove an error variant, test compilation will fail with a "no
variant named `RemovedError`" message.

You can get the list of error variants and their current text via
`cargo test -p router -- print_out_error_text --nocapture`.

A step towards accomplishing #5863

Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@gmail.com>
Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

* fix: Remove optional commas and document macro arguments

* docs: Clarify the purpose of the tests the check_errors macro generates

* fix: Add tests for inner mutable batch LP error variants

Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-09 09:37:55 +00:00
dependabot[bot] 679a7958b2
chore(deps): Bump hyper from 0.14.22 to 0.14.23 (#6080)
Bumps [hyper](https://github.com/hyperium/hyper) from 0.14.22 to 0.14.23.
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/v0.14.23/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v0.14.22...v0.14.23)

---
updated-dependencies:
- dependency-name: hyper
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-09 09:15:12 +00:00
dependabot[bot] 8edd640e05
chore(deps): Bump cc from 1.0.74 to 1.0.76 (#6092)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.74 to 1.0.76.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.74...1.0.76)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-09 09:07:42 +00:00
Marco Neumann 1a5fc3d772
test: use `EXPLAIN ANALYZE` for SQL metric tests (#6084)
* test: use `EXPLAIN ANALYZE` for SQL metric tests

Needs a bit more infra (due to normalization), but this seems to be
worth it so we can easily hook up more metrics in the future.

* docs: explain regexes
2022-11-09 09:00:27 +00:00
Stuart Carnie 106d3a76de
feat: Parse InfluxQL line and inline comments (#6076)
* feat: Added single and inline comment combinators

* chore: Add tests for ws0 function

* feat: Add ws1 combinator

* feat: Use ws0 and ws1 combinators to properly handle comments
2022-11-08 22:53:19 +00:00
Luke Bond dfb820615c
feat: deletion flagging in GC based on retention policy (#6073)
* feat: deletion flagging in GC based on retention policy

* chore: typo in comment

* fix: only soft delete parquet files that aren't yet soft deleted

* fix: guard against flakiness in catalog test

* chore: some better tests for parquet file delete flagging

Co-authored-by: Nga Tran <nga-tran@live.com>
2022-11-08 20:22:35 +00:00
Dom aebf2024a4
Merge pull request #6069 from influxdata/dom/kafka-ids-consumer
perf(ingester): eliminate table / namespace queries
2022-11-08 16:20:25 +00:00
Dom Dwyer 38b0459994 test: simplify tests / remove catalog
Remove the catalog from tests that only initialised an implementation in
order to call buffer_operation().
2022-11-08 17:02:01 +01:00
Dom Dwyer 226f14a97f perf(ingester): remove table lookup query
Now DML operations contain the table ID, the ingester has all necessary
data to initialise the TableData buffer node without having to query the
catalog.

This also removes the catalog from the buffer_operation() call path,
simplifying testing.
2022-11-08 17:00:44 +01:00
Dom Dwyer 225c3b97c1 perf(ingester): remove namespace lookup query
Now DML operations contain the namespace ID, the ingester has all
necessary data to initialise the NamespaceData buffer node without
having to query the catalog.
2022-11-08 16:57:53 +01:00
Dom Dwyer 8ebea0df37 feat: table/namespace IDs in write protocol
Expose the Table and Namespace IDs encoded within the serialised DML
write (added in #6036).

This makes the IDs available for use in the consumers, ending the
transition period. This commit DOES NOT remove the strings sent over the
wire.
2022-11-08 16:57:53 +01:00
Dom ea936024a2
Merge pull request #6088 from influxdata/dom/mutex-pushdown
perf(ingester): mutex pushdown
2022-11-08 15:30:05 +00:00
Dom b7f7ee6a13
Merge branch 'main' into dom/mutex-pushdown 2022-11-08 14:57:32 +00:00
Dom Dwyer b73d07c22b perf(ingester): granular per-partition locking
This commit pushes the existing table-level mutex down to the partition.

This allows the ingester to gather data from multiple partitions within
a single table in parallel, and reduces contention between ingest/query
workloads.
2022-11-08 15:45:59 +01:00
Dom Dwyer b8181119e1 refactor: push down per-partition op skipping
This moves the logic that skips operations that do not need to be
applied to a partition during shard replay from the table level, to the
partition level.
2022-11-08 15:45:52 +01:00
kodiakhq[bot] 83230495c2
Merge pull request #6086 from influxdata/dom/arcmap-get
fix: cross-thread ArcMap::get()
2022-11-08 14:24:52 +00:00
Dom Dwyer 4c8882e33a docs: ref link to fix PR 2022-11-08 15:17:46 +01:00
Dom Dwyer d71f023a57 refactor: inline helpers
Inline the hash generation & key comparator.
2022-11-08 15:17:46 +01:00
Dom Dwyer 8dd7f2c603 refactor: accept owned key for insert()
Changes the bounds on the ArcMap to accept an owned key, avoiding an
extra allocation.

Cleans up the bounds on other fn to ensure the borrowed key impl Eq and
is the ref type of K.
2022-11-08 15:17:46 +01:00
Dom Dwyer bbc2afe2a1 refactor: extract key equality checking
Creates a shared fn for checking key equality to DRY the various
chaining checks.
2022-11-08 15:17:46 +01:00
Dom Dwyer 8eaccd518b fix: cross-thread map entry visibility
This commit changes the ArcMap HashBuilder to use the same instance as
the underlying HashMap hasher.

This prevents divergent hashing across threads that MAY initialise a
hasher with a different seed.
2022-11-08 15:17:46 +01:00
Dom Dwyer 66a6e8e929 test: cross-thread hashmap entry visibility
At the time of this commit, this test fails. Performing a get() on a key
previously inserted by another thread should not fail.
2022-11-08 15:17:46 +01:00
dependabot[bot] efe63655a8
chore(deps): Bump regex-syntax from 0.6.27 to 0.6.28 (#6082)
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.6.27 to 0.6.28.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/commits)

---
updated-dependencies:
- dependency-name: regex-syntax
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-08 13:59:15 +00:00
dependabot[bot] 96f93ab2fb
chore(deps): Bump ahash from 0.8.0 to 0.8.1 (#6032)
* chore(deps): Bump ahash from 0.8.0 to 0.8.1

Bumps [ahash](https://github.com/tkaitchuck/ahash) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/tkaitchuck/ahash/releases)
- [Commits](https://github.com/tkaitchuck/ahash/compare/v0.8.0...v0.8.1)

---
updated-dependencies:
- dependency-name: ahash
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: Undo the lock of ahash to 0.8.0; cargo hakari is fixed now

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-08 12:56:15 +00:00
dependabot[bot] bdb5ac10da
chore(deps): Bump ordered-float from 3.3.0 to 3.4.0 (#6081)
Bumps [ordered-float](https://github.com/reem/rust-ordered-float) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/reem/rust-ordered-float/releases)
- [Commits](https://github.com/reem/rust-ordered-float/compare/v3.3.0...v3.4.0)

---
updated-dependencies:
- dependency-name: ordered-float
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-08 12:46:10 +00:00
dependabot[bot] f57346a806
chore(deps): Bump clap from 4.0.19 to 4.0.22 (#6079)
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.19 to 4.0.22.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.0.19...v4.0.22)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-08 12:36:56 +00:00
Marco Neumann 903f7bafa7
refactor: expose `ParquetExec` directly to DataFusion phys. plan (#6072)
* refactor: expose `ParquetExec` directly to DataFusion phys. plan

Closes #5897.

* fix: update tracing tests

* refactor: use `EmptyExec`

* refactor: use `target_partitions`

* refactor: improve UUID normalization in query tests

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-11-08 12:19:28 +00:00
dependabot[bot] dcbe36103e
chore(deps): Bump pprof from 0.10.1 to 0.11.0 (#6077)
Bumps [pprof](https://github.com/tikv/pprof-rs) from 0.10.1 to 0.11.0.
- [Release notes](https://github.com/tikv/pprof-rs/releases)
- [Changelog](https://github.com/tikv/pprof-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tikv/pprof-rs/commits)

---
updated-dependencies:
- dependency-name: pprof
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-08 10:04:59 +00:00
dependabot[bot] ce39b2a385
chore(deps): Bump regex from 1.6.0 to 1.7.0 (#6078)
Bumps [regex](https://github.com/rust-lang/regex) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.6.0...1.7.0)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-08 09:57:49 +00:00
kodiakhq[bot] 7727f459cb
Merge pull request #6083 from influxdata/dom/revert-granular-locking
revert: granular locking
2022-11-08 09:42:19 +00:00
Dom Dwyer fbd25a06d0 revert: push down per-partition op skipping
This reverts commit 425fd46def.
2022-11-08 10:31:51 +01:00
Dom Dwyer 7ac0857a28 revert: granular per-partition locking
This reverts commit 79d24fa350.
2022-11-08 10:31:37 +01:00
Stuart Carnie 30c353e9c0
feat: Add parser for `CREATE DATABASE` statement (#6062)
* feat: Add parser for `CREATE DATABASE` statement

* feat: Improved errors and added associated tests
2022-11-08 00:43:29 +00:00
kodiakhq[bot] 32569ad1ff
Merge pull request #6053 from influxdata/cn/order-by-insert
fix: use `ORDER BY` to prevent `INSERT` deadlocks
2022-11-07 19:24:47 +00:00
kodiakhq[bot] 369937d68f
Merge branch 'main' into cn/order-by-insert 2022-11-07 19:18:13 +00:00