Commit Graph

9058 Commits (e6f2a105e56d55464cb6abe8d1fe94068b27dd95)

Author SHA1 Message Date
Marco Neumann f45cbfb88d
refactor: fine-grained file size mocking (#5541)
* refactor: do not override parquet file size in querier

This is going to be an issue when we actually rely on the size for
reading, see #5531.

* refactor: use selected file size mocking in compactor

Do not blindly override parquet file sizes for all subsystems.

This is going to be an issue when we actually rely on the size for
reading, see #5531.

* refactor: remove ability to override file sizes in catalog

Blindly overriding data for all subsystems is dangerous, because some
parts of our stack actually rely on the actual file size. See #5531.

* docs: explain `size_overrides`
2022-09-05 08:50:04 +00:00
Andrew Lamb 1e1d964fdb fix: Some other stragglers 2022-09-04 07:59:07 -04:00
Juul Christiaens 8b419ecd84 refactor: changed iox_shared to iox-shared
changed io_shared to iox-shared in the following files: update_catalog.rs, partition.rs, lib.rs (in the service_grpc_catalog folder) and lib.rs (in the service_grpc_object_store folder).
2022-09-04 07:59:07 -04:00
Nga Tran dde65fa7ef
fix: remove timestamp functions from SQLs to be able to use index for improving performance (#5547) 2022-09-02 19:43:52 +00:00
Nga Tran cbfd37540a
feat: add index on parquet_file(shard_id, compaction_level, to_delete, created_at) (#5544) 2022-09-02 14:27:29 +00:00
Marco Neumann e04a9d875a
refactor: use concrete loader type within `CacheDriver` (#5532)
There's no technical reason to dyn-dispatch the loader. The user may
free to do so however.

Note that there's no change within `querier` because the type
inference will now automatically treat the passed `Arc` as `Arc<L>`
insteado of `Arc<dyn Loader<...>>`.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-02 11:30:47 +00:00
Andrew Lamb 61d1b9b0d6
chore: Add test for running a query after swapping out a sqlx pool (#5543)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-02 11:23:35 +00:00
Marco Neumann 92656edddd
chore: upgrade jemalloc to version 5.3.0 (#5542)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-02 10:45:13 +00:00
Marco Neumann 0a0b3bd95b
feat: querier object store cache (#5527)
* feat: querier object store cache

* docs: improve

Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>

Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
2022-09-02 09:48:53 +00:00
dependabot[bot] b5c4576c8a
chore(deps): Bump clap from 3.2.19 to 3.2.20 (#5539)
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.19 to 3.2.20.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/v3.2.20/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.19...v3.2.20)

---
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>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-02 08:23:18 +00:00
Carol (Nichols || Goulding) d84b062a69
fix: Improve debugging ability for influxdb2_client (#5533)
* fix: Separate errors to make debugging easier

* feat: Turn on reqwest verbose connection logging for debugging

https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html#method.connection_verbose

> Enabling this option will emit log messages at the TRACE level for read and write operations on connections.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-02 05:09:10 +00:00
Stuart Carnie d219f93241
feat: Implementation of expression parsing for InfluxQL (#5469)
* feat: Partial implementation of expression parsing for InfluxQL

* chore: Add nom 7.x compatible precedence package

Simplifies definition of operator precedence

* feat: Add BindParameter parser

* feat: Add BindParameter expression type

* feat: Add conditional operators

* chore: Revert "chore: Add nom 7.x compatible precedence package"

This reverts commit e681dd03

* feat: Corrected unary operator precedence

* chore: Rename combinator functions

* chore: Add missing keywords

* feat: Parse regular expression conditions

Also ensure regex's are only accepted for regular expression
conditional expressions.

* chore: Fix bind parameter link

* chore: Fix broken doc link

* chore: Make conditional expression API public

* chore: More test cases

* chore: consistent whitespace handling

* chore: PR Feedback to include additional operator precedence tests
2022-09-02 00:32:57 +00:00
kodiakhq[bot] 176d86a7c9
Merge pull request #5534 from influxdata/cn/even-more-compactor-tests
test: Refactor and add some more compactor tests
2022-09-01 21:08:55 +00:00
kodiakhq[bot] b9959fa2d8
Merge branch 'main' into cn/even-more-compactor-tests 2022-09-01 21:02:04 +00:00
Nga Tran c8cbc5299b
feat: make compactors to select candidates based on the last n minutes (#5535)
* feat: make compactors to select candidates based on the last n minutes to reduce workload for postgres catalog query

* refactor: remove 1-minute case per review comment
2022-09-01 20:07:26 +00:00
kodiakhq[bot] abc6828689
Merge pull request #5475 from influxdata/cn/db-rename
feat: database rename
2022-09-01 16:45:01 +00:00
kodiakhq[bot] 3b0a1ee245
Merge branch 'main' into cn/db-rename 2022-09-01 16:37:52 +00:00
Marco Neumann 8aa57ac0d4
refactor: do not always box `FunctionLoader` (#5530)
* refactor: do not always box `FunctionLoader`

While constructing our caches, we rarely spell out types. Instead we
just "box" the end result (`Box<dyn Cache<...>>`) before storing it
within the struct (e.g. `NamespaceCache`).

This means that `FunctionLoader` does NOT need to erase the type of the
function it contains. This saves us a `Box` which means less pointer
chasing and more room for the compiler to optimize.

* docs: typos

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-09-01 14:18:55 +00:00
Carol (Nichols || Goulding) 8a0fa616cf
fix: Rename columns, tables, indexes and constraints in postgres catalog 2022-09-01 10:00:54 -04:00
Marco Neumann 5e187ae1c0
refactor: use concrete type in `MetricsLoader` (#5525)
The API user may still use a `Box<dyn ...>` if they want, but they
technically don't have to.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-01 12:22:12 +00:00
dependabot[bot] 3971c67beb
chore(deps): Bump futures-task from 0.3.23 to 0.3.24 (#5501)
Bumps [futures-task](https://github.com/rust-lang/futures-rs) from 0.3.23 to 0.3.24.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.23...0.3.24)

---
updated-dependencies:
- dependency-name: futures-task
  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: Dom <dom@itsallbroken.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-01 12:15:08 +00:00
dependabot[bot] 7c61bdcf35
chore(deps): Bump paste from 1.0.8 to 1.0.9 (#5526)
Bumps [paste](https://github.com/dtolnay/paste) from 1.0.8 to 1.0.9.
- [Release notes](https://github.com/dtolnay/paste/releases)
- [Commits](https://github.com/dtolnay/paste/compare/1.0.8...1.0.9)

---
updated-dependencies:
- dependency-name: paste
  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-09-01 12:07:53 +00:00
dependabot[bot] fc162b9dc2
chore(deps): Bump clap from 3.2.17 to 3.2.19 (#5514)
Bumps [clap](https://github.com/clap-rs/clap) from 3.2.17 to 3.2.19.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/v3.2.19/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.2.17...v3.2.19)

---
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>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-01 11:03:52 +00:00
Marko Mikulicic 15369d4c52
feat: Implement gRPC binary logger (#5473)
* feat: Implement gRPC binary logger

* chore: Run cargo hakari tasks

* fix: Apply suggestions from code review

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-01 10:57:02 +00:00
dependabot[bot] e7d75a5513
chore(deps): Bump futures-sink from 0.3.23 to 0.3.24 (#5495)
Bumps [futures-sink](https://github.com/rust-lang/futures-rs) from 0.3.23 to 0.3.24.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.23...0.3.24)

---
updated-dependencies:
- dependency-name: futures-sink
  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: Dom <dom@itsallbroken.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-01 10:49:38 +00:00
dependabot[bot] 06825d5592
chore(deps): Bump sha2 from 0.10.2 to 0.10.3 (#5513)
Bumps [sha2](https://github.com/RustCrypto/hashes) from 0.10.2 to 0.10.3.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha2-v0.10.2...sha2-v0.10.3)

---
updated-dependencies:
- dependency-name: sha2
  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-09-01 10:42:06 +00:00
dependabot[bot] c4d203de5c
chore(deps): Bump md-5 from 0.10.1 to 0.10.2 (#5515)
Bumps [md-5](https://github.com/RustCrypto/hashes) from 0.10.1 to 0.10.2.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/md2-v0.10.1...md-5-v0.10.2)

---
updated-dependencies:
- dependency-name: md-5
  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-09-01 10:35:07 +00:00
dependabot[bot] 9ba9128887
chore(deps): Bump httparse from 1.7.1 to 1.8.0 (#5516)
Bumps [httparse](https://github.com/seanmonstar/httparse) from 1.7.1 to 1.8.0.
- [Release notes](https://github.com/seanmonstar/httparse/releases)
- [Commits](https://github.com/seanmonstar/httparse/compare/v1.7.1...v1.8.0)

---
updated-dependencies:
- dependency-name: httparse
  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-09-01 10:27:36 +00:00
dependabot[bot] 9af93ca9ba
chore(deps): Bump pretty_assertions from 1.2.1 to 1.3.0 (#5517)
Bumps [pretty_assertions](https://github.com/rust-pretty-assertions/rust-pretty-assertions) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/rust-pretty-assertions/rust-pretty-assertions/releases)
- [Changelog](https://github.com/rust-pretty-assertions/rust-pretty-assertions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-pretty-assertions/rust-pretty-assertions/compare/v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: pretty_assertions
  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-09-01 10:20:26 +00:00
dependabot[bot] 00ed79ff1b
chore(deps): Bump thiserror from 1.0.32 to 1.0.33 (#5524)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.32 to 1.0.33.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.32...1.0.33)

---
updated-dependencies:
- dependency-name: thiserror
  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-09-01 09:11:31 +00:00
Marco Neumann c59dd01742
refactor: use concrete inner type in `CacheWithMetrics` (#5522)
The API user still CAN use dynamic dispatch but doesn't have to. This
also simplifies the generics a bit.

This is similar to #5520.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-09-01 06:05:59 +00:00
Stuart Carnie 1fb9423f98
feat: Teach IOx how to parse InfluxQL literals (#5460)
* feat: Parse various InfluxQL literals

* feat: Parse regex, refactor single and double quoted string parsing

* chore: Literals do not include sign; those are unary expressions

* chore: Add docs

* chore: Integer literals are unsigned

Add more tests for max values

* chore: Impl Display for Literal; add macro to write escaped strings

Also added Duration type for InfluxQL durations, so they can be properly
formatted when displayed.

The macro uses match to efficiently map a small number of characters
to their escaped equivalent. It also removes a bit of boilerplate.

* chore: Don't tie lifetime of AST elements to source `str`

* feat: Impl From trait for Literal, Regex and Duration

* chore: Derive Copy for Duration

* chore: PR Feedback, use unwrap_err for better output when API fails

* chore: Drive-by cleanup using unwrap_err
2022-08-31 23:44:58 +00:00
Carol (Nichols || Goulding) 16d631a247
test: Add test for current behavior of skipping a table without columns 2022-08-31 16:26:02 -04:00
Carol (Nichols || Goulding) 1120b49821
refactor: Extract the mock compactor function into a type 2022-08-31 16:17:43 -04:00
Carol (Nichols || Goulding) b893251efc
test: Add a test that compacting no candidates compacts nothing 2022-08-31 15:30:25 -04:00
kodiakhq[bot] 26dfccf26e
Merge pull request #5523 from influxdata/cn/more-compactor-tests
refactor: Use more iox test utils in compactor tests
2022-08-31 19:10:24 +00:00
Carol (Nichols || Goulding) 62b8819d49
fix: Carry object store ID through test builder, but pick new every time 2022-08-31 14:58:46 -04:00
Carol (Nichols || Goulding) b0e871196c
test: Use more iox test utils in this compactor test 2022-08-31 14:37:59 -04:00
Carol (Nichols || Goulding) a9d664d0bf
feat: Add a way to set the row count on Parquet file catalog entries
And only allow setting this when no record batch or line protocol is
specified so that there isn't a way to create a parquet file with data
that has a mismatched row count.
2022-08-31 14:36:42 -04:00
Carol (Nichols || Goulding) c21ac9050b
refactor: Extract a test util fn that will only create parquet file catalog records 2022-08-31 14:00:00 -04:00
Nga Tran a32d5180b3
fix: loop forever in compact_hot_partition_candidates (#5518)
* fix: loop forever in compact_hot_partition_candidates

* chore: cleanup

* fix: avoid using continues that will cause bugs in corner cases

* fix: Pass compaction fn as a closure instead to allow collection of groups in test

* fix: Add Send bound as suggested by clippy

* fix: fix the test to return data of round 3 instead of round 2

Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-08-31 17:46:59 +00:00
YIXIAO SHI 22c3de3cbc
feat: router write line protocol duration (#5507)
* feat: router write line protocol duration

* feat: `http_write_lines_duration` metric add attributes.

* chore: cargo fmt -all

* chore: rename metric name and delete metric label

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-08-31 16:19:18 +00:00
Marco Neumann c0dda14cef
refactor: use concrete backend type in `CacheDriver` (#5520)
This removes some `Box<dyn ...>` indirection when the user doesn't want
it (you still can, but don't have to) and makes the whole type handling
easier to understand.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-08-31 14:58:25 +00:00
Dom b8ef1693a3
Merge pull request #5521 from influxdata/dom/ingester-row-limit
feat(ingester): restrict partition row count
2022-08-31 15:03:39 +01:00
Dom ed2490deb2
Merge branch 'main' into dom/ingester-row-limit 2022-08-31 14:56:42 +01:00
Dom Dwyer 2a19606456 feat(ingester): restrict partition row count
This limit restricts a single partition to containing at most N rows
before it is marked for persistence (note: being marked for persistence
does not currently prevent further ingest for that partition.)
2022-08-31 15:48:18 +02:00
Andrew Lamb 6669d85fb4
chore: Update datafusion + arrow/parquet to `21.0.0` (#5519)
* chore: Update arrow/arrow-flight/parquet to 21.0.0

* chore: Update datafusion pin

* chore: Fix arrow update script

* chore: Update Cargo.lock

* chore: Update for new API
2022-08-31 13:30:47 +00:00
Nga Tran cb10a7c6d8
feat: More accurate memory estimate for compaction (#5471)
* feat: initial implementation of memory estimation for a compaction

* feat: estimate size of files and have the right actions for the needed budget

* feat: run candidates in parallel

* fix: have the right name for the column field of the output struct

* feat: add metrics for estimated budgets

* chore: cleanup

* chore: Apply suggestions from code review

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>

* fix: fix syntax after applying review's suggestions

* refactor: Convert a Vec to VecDeque to go well with pop and push

* chore: remove max_concurrent_size_bytes and input_size_threshold_bytes

* chore: remove input_file_count_threshold

* test: tests for estimate_arrow_bytes_for_file

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-08-30 13:44:44 +00:00
Dom 887d73f7e1
Merge pull request #5510 from influxdata/dom/empty-parquet
fix: remove empty parquet panic
2022-08-30 14:20:20 +01:00
Dom Dwyer 2fc0ddbea1 fix: compactor tolerates empty output
Changes the compactor code to tolerate a SplitExec yielding an empty
partition (with no rows).

This raises a WARN as the situation in which this is acceptable is very
rare, and is more likely indicative of an opportunity to improve the
SplitExec usage (i.e. pruning out unnecessary split points).
2022-08-30 14:52:31 +02:00