Commit Graph

594 Commits (7daf680e76ac035342094c4bc00c890ffbcdfa54)

Author SHA1 Message Date
Andrew Lamb 4ca52e5ae0
refactor: Extract common, OG database and router out of influxdb_ioxd (#4149)
* refactor: Extract common, OG database and router out of influxdb_ioxd

* chore: Run cargo hakari tasks

Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
2022-03-29 13:07:19 +00:00
dependabot[bot] 17af5fcbd1
chore(deps): Bump tokio-util from 0.7.0 to 0.7.1 (#4154)
* chore(deps): Bump tokio-util from 0.7.0 to 0.7.1

Bumps [tokio-util](https://github.com/tokio-rs/tokio) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-util-0.7.0...tokio-util-0.7.1)

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

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

* chore: Run cargo hakari tasks

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-29 08:39:02 +00:00
Andrew Lamb 196ad50f5a
test: add e2e test for schema CLI (#4132)
* test: add e2e test for schema CLI

* fix: logical confict
2022-03-25 18:11:03 +00:00
Marco Neumann 9886ff42cc refactor: clean up querier public interface 2022-03-25 11:54:52 +01:00
Andrew Lamb e222acbb48
refactor: use typed `TestConfig` rather than environment variable names for NG end to end tests (#4126)
* refactor: move environment variable mapping in end to end tests into TestConfig

* fix: clippy

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-24 18:36:47 +00:00
Andrew Lamb 39d9f30f12
refactor: Make `server` an implementation detail (#4122) 2022-03-24 15:58:04 +00:00
Andrew Lamb 5c69a3f43b
chore: Update deps: datafusion, arrow/arrow-flight/parquet to 11, zstd to 0.11 (#4119)
* chore: update datafusion

* chore(deps): Bump arrow from 10.0.0 to 11.0.0

Bumps [arrow](https://github.com/apache/arrow-rs) from 10.0.0 to 11.0.0.
- [Release notes](https://github.com/apache/arrow-rs/releases)
- [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apache/arrow-rs/compare/10.0.0...11.0.0)

---
updated-dependencies:
- dependency-name: arrow
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* chore(deps): Bump arrow-flight from 10.0.0 to 11.0.0

Bumps [arrow-flight](https://github.com/apache/arrow-rs) from 10.0.0 to 11.0.0.
- [Release notes](https://github.com/apache/arrow-rs/releases)
- [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apache/arrow-rs/compare/10.0.0...11.0.0)

---
updated-dependencies:
- dependency-name: arrow-flight
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* chore: update parquet to 11.0.0

* fix: error on create schema, test for same

* fix: upgrade zstd

* chore: Run cargo hakari tasks

* fix: fix logical merge conflict

* fix: hakari

* fix: hakari

* fix: update newly introduced dep

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-24 15:27:36 +00:00
Andrew Lamb fb75ef7b82
test: add end to end test for all in one mode, restructure fixture (#4114)
* test: add end to end test for all in one mode, restructure fixture

* docs: fix typos and clarify schema requrements
2022-03-24 12:53:25 +00:00
Andrew Lamb 7f2c2fde2c
fix: fix all in one mode argument handling so it can start (#4115)
* fix: fix all in one mode argument handling

* fix: clippy

* fix: fmt

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-23 18:16:22 +00:00
Paul Dix 4f5321d19b
feat: add compactor configuration for kafka topic and sequencers (#4107) 2022-03-23 14:11:47 +00:00
Luke Bond e109fa4987
feat: schema client and CLI (#4105)
* feat: schema client and CLI

* chore: clarification in comment in schema command

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

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-23 13:49:24 +00:00
Andrew Lamb b83b000590
chore: Update datafusion (#4071)
* chore: update to datafusion 5936edc2a94d5fb20702a41eab2b80695961b9dc

* chore: Update apis to match datafusion changes
2022-03-22 13:17:41 +00:00
Dom Dwyer 6fb1a9b592 feat(querier): enable object store metrics 2022-03-15 16:32:52 +00:00
Dom Dwyer f4d836eed7 feat(ingester): enable object store metrics 2022-03-15 16:32:52 +00:00
Dom Dwyer 65273721b6 feat(compactor): enable object store metrics 2022-03-15 16:32:52 +00:00
Dom Dwyer 5585dd3c21 refactor: switch to using DynObjectStore
Changes all consumers of the object store to use the dynamically
dispatched DynObjectStore type, instead of using a hardcoded concrete
implementation type.
2022-03-15 16:32:52 +00:00
Dom Dwyer 1d5066c421 refactor: rename ObjectStore -> ObjectStoreImpl
Frees up the name for so we can use `dyn ObjectStore` throughout the
code instead of `ObjectStoreApi`.
2022-03-15 16:29:43 +00:00
Andrew Lamb 9b3f946c10
feat: all in 1 IOx NG mode (#3965)
* feat: Add all_in_one mode

* fix: doc

* docs: fix truncated docs

* refactor: correctly identify PG connections

* refactor: resolve failed merge

Co-authored-by: Dom Dwyer <dom@itsallbroken.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-15 16:28:37 +00:00
Nga Tran 5a29d070ea
feat: Implement the compact function for NG Compactor (#4001)
* feat: initial implementation of compact a given list of overlapped parquet files

* feat: Add QueryableParquetChunk and some refactoring

* feat:  build queryable parquet chunks for parquet files with tombstones

* feat: second half the implementation for Compactor's compact. Tests will be next

* fix: comments for trait funnctions fof QueryChunkMeta

* test: add tests for compactor's compact function

* fix: typos

* refactor: address Jake's review comments

* refactor: address Andrew's comments and add one more test for files in different order in the vector

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-11 20:25:19 +00:00
Andrew Lamb cc4875cca0
refactor: decouple ingester setup and creation logic from the config structs (#4020)
* refactor: decouple ingester setup and creation logic from the config structs

* fix: clippy

* refactor: remove comments
2022-03-11 19:25:50 +00:00
Andrew Lamb b24ae7d23b
refactor: extract out compactor creation from config (#4018)
* refactor: extract out compactor creation from config

* fix: fmt

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-11 14:46:34 +00:00
Andrew Lamb 29df46975f
refactor: extract out querier creation from config (#4017)
* refactor: extract out querier creation from config

* fix: clippy
2022-03-11 14:38:09 +00:00
dependabot[bot] bd2824aa59
chore(deps): Bump pprof from 0.6.2 to 0.7.0 (#4004)
* chore(deps): Bump pprof from 0.6.2 to 0.7.0

Bumps [pprof](https://github.com/tikv/pprof-rs) from 0.6.2 to 0.7.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>

* fix: `pprof` features for version 0.7

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marco Neumann <marco@crepererum.net>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-11 11:08:59 +00:00
Nga Tran f03ebd79ab
refactor: move querier's test utils to a new crate to get reused by tests in other crates (#4013)
* refactor: move querier's test utils to a new crate to be able resued by tests in other crates

* chore: remove unused import
2022-03-10 18:17:58 +00:00
Andrew Lamb 2c3d30ca32
chore: Update datafusion, arrow, flight and parquet (#4000)
* chore: Update datafusion, arrow, flight and parquet

* fix: api change

* fix: fmt

* fix: update test metadata size

* fix: Update sizes in parquet test

* fix: more metadata size update
2022-03-10 12:24:47 +00:00
Carol (Nichols || Goulding) c891f3c4f2
fix: Print an error with sample env var variable if unset 2022-03-09 09:55:43 -05:00
Carol (Nichols || Goulding) 8af2f60b59
fix: Run catalog setup as part of end-to-end test setup 2022-03-09 09:55:43 -05:00
Carol (Nichols || Goulding) 93b0cdbcc4
fix: Create the test database as part of ng server fixture startup 2022-03-09 09:55:43 -05:00
Carol (Nichols || Goulding) e4fb227c6e
feat: Set the catalog URL explicitly in the test config 2022-03-09 09:55:43 -05:00
Carol (Nichols || Goulding) 465fb0272d
fix: Remove unneeded server id const 2022-03-09 09:55:43 -05:00
Carol (Nichols || Goulding) 6d086705a8
fix: Remove ng create_shared server fixture method for now 2022-03-09 09:55:42 -05:00
Carol (Nichols || Goulding) e315012fe3
fix: Switch NG tests to use TEST_INFLUXDB_IOX_CATALOG_DSN too 2022-03-09 09:55:42 -05:00
Carol (Nichols || Goulding) a14e642f39
refactor: Extract NG end-to-end tests from OG end-to-end tests 2022-03-09 09:55:42 -05:00
Carol (Nichols || Goulding) 1536bdeca0
test: Add an end-to-end NG test 2022-03-09 09:55:42 -05:00
Carol (Nichols || Goulding) 66a5649258
test: Print out the server type with server log messages
So that when you have more than one server running in a test, it's
easier to see which one is saying what
2022-03-09 09:55:42 -05:00
Carol (Nichols || Goulding) ae45d9f750
test: Add Router2 as a supported ServerFixture type 2022-03-09 09:55:42 -05:00
Andrew Lamb d2c0acdd46
refactor: Remove serving readiness gate (#3986)
* refactor: Remove serving_readiness

* fix: remove more

* fix: remove test

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-09 12:17:44 +00:00
Nga Tran 09fba1d2c0
feat: NG Compactor - main function for finding and compacting parquet files (#3973)
* feat: main function for finding and compacting parquet files

* chore: Apply suggestions from code review

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

* refactor: rename file and struct

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-08 16:34:43 +00:00
Andrew Lamb 357ea52d8d
refactor: decouple router2 setup and creation logic from the config structs, switch to `Arc<dyn ServerType>` (#3969)
* refactor: Extract router server instantiation into `influxdb_ioxd`

* refactor: complete dyn ServerType

* fix: remove some leftovers

* fix: clippy

* fix: restore startup message order

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-08 14:06:18 +00:00
Andrew Lamb 7fa17ef1d7
refactor: remove unused error enums (#3970)
* refactor: remove unused error enums

* fix: fmt

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-07 21:40:55 +00:00
Paul Dix 337e432a0f
feat: ingester persists on cold partitions (#3942)
Add configuration and lifecycle to trigger partition persistence if it hasn't received a write in a given number of secods.

Fixes #3869
2022-03-07 18:55:56 +00:00
Dom Dwyer aaec1c7828 build: propagate feature flags to influxdb_ioxd
When you did a "cargo build --no-default-features" before this commit,
the influxdb_iox crate was compiled without the default features
(namely jemalloc stuff) but the influxdb_ioxd crate was compiled with
jemalloc (it was not possible to compile without jemalloc support).

This commit fixes propagation of the jemalloc flag
("jemalloc_replacing_malloc") into the influxdb_ioxd crate.
2022-03-07 15:44:13 +00:00
Raphael Taylor-Davies 80fb75d90b
feat: add a flag to enable per-partition tracing (#3928)
* feat: add a flag to enable per-partition tracing

* chore: rename constant

* feat: use BooleanFlag and cache result
2022-03-07 13:49:23 +00:00
kodiakhq[bot] e47bfc40be
Merge branch 'main' into dom/router-grpc-write 2022-03-07 11:13:19 +00:00
dependabot[bot] 48908054d1
chore(deps): Bump once_cell from 1.9.0 to 1.10.0 (#3955)
* chore(deps): Bump once_cell from 1.9.0 to 1.10.0

Bumps [once_cell](https://github.com/matklad/once_cell) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.9.0...v1.10.0)

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

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

* chore: Run cargo hakari tasks

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: CircleCI[bot] <circleci@influxdata.com>
2022-03-07 08:54:20 +00:00
Dom Dwyer 7c5ba34d44 refactor: enable gRPC handler
Plumbs the gRPC write handler into the existing router2 server.
2022-03-04 14:51:43 +00:00
Raphael Taylor-Davies 636381c805
fix: fix read-window-aggregate CLI defaults (#3930) 2022-03-04 12:09:07 +00:00
Dom Dwyer bb9b140f4b refactor: sequencer metrics
Records per-sequencer (kafka partition) enqueue latency / counts broken
down by operation success/error.
2022-03-03 23:40:13 +00:00
Raphael Taylor-Davies e304613546
feat: include trace ID in query log (#3912) (#3923)
* feat: include trace ID in query log (#3912)

* chore: fmt

* chore: lint
2022-03-03 17:50:49 +00:00
Andrew Lamb d6afda0227
refactor: split `influxdb_ioxd`, `clap_blocks` and `serving_readiness` from influxdb_iox crate (#3908)
* refactor: split influxdb_ioxd, clap_blocks, and serving_readiness out of influxdb_iox

split out serving readiness, get compiling

* fix: hakari

* fix: hakari again

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-03 16:48:30 +00:00
Raphael Taylor-Davies 82aa314659
feat: make wait-server-initialized wait for database init (#3915)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-03 15:37:22 +00:00
Edd Robinson ea32bc366a feat: add read_group tracing 2022-03-03 14:27:01 +00:00
Edd Robinson 32baaa1ee7 feat: add tracing to field_columns 2022-03-03 14:27:01 +00:00
Edd Robinson 787a848bf5 feat: add tracing for tag_values 2022-03-03 14:27:01 +00:00
Edd Robinson 6a6fbf73ae feat: add tracing support tag_keys 2022-03-03 14:27:01 +00:00
kodiakhq[bot] 04a7a957fe
Merge branch 'main' into dom/rustls 2022-03-03 11:59:40 +00:00
kodiakhq[bot] c0ebe5a2f1
Merge branch 'main' into dom/fix-feature-flags 2022-03-03 11:48:35 +00:00
Dom Dwyer 6204a9046d fix: jemalloc feature flag
In #2435 we moved the jemalloc metrics around, and missed a few feature
gates to avoid pulling in jemalloc unless it is requested.
2022-03-03 11:48:24 +00:00
Raphael Taylor-Davies 0660b514e3
feat: allow persisting all partitions and/or all tables from CLI (#3874)
* feat: allow persisting all partitions and/or all tables

* chore: use BTreeSet

* feat: non-zero exit code on error continue

* test: test continue-on-error

* chore: review feedback

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-03 11:17:34 +00:00
Dom Dwyer 46bb107be4 refactor: use rustls
Removes openssl as a dependency, switching to rustls[1] as the TLS
implementation throughout.

It is important to note that this change brings with it a significant
behavioural difference - rustls does not currently support IP SANs in
certificates (instead only supporting fully-qualified names / DNS) and
this will manifest as a failure to connect to IP endpoints over TLS.
This might be a blocker that prevents us using rustls exclusively, but
there's noe asy way to know without trying it. Fortunately the rustls
project has received funding to work on IP SAN support[2].

[1]: https://github.com/rustls/rustls
[2]: https://www.abetterinternet.org/post/preparing-rustls-for-wider-adoption/
2022-03-03 11:05:20 +00:00
kodiakhq[bot] caba3e9fd2
Merge branch 'main' into cn/querier-flight-request 2022-03-02 20:30:00 +00:00
Carol (Nichols || Goulding) 806a43eb6c
fix: Temporarily remove ingester end-to-end test case
This now needs more setup because without any data, the flight query
request returns an error. The setup is proving to be nontrivial.
2022-03-02 15:29:48 -05:00
Edd Robinson 3d047073b9
feat: add tracing down to the chunk level (#3804)
* refactor: wire exectution context to Deduplicator

* feat: example trace to chunk read_filter

* refactor: make execution context required

* refactor: expose metadata API

* refactor: more span context for chunk read_filter

* refactor: fix build

* refactor: push context into result stream

* refactor: make executor optional
2022-03-02 19:08:22 +00:00
Carol (Nichols || Goulding) 2a90841715
refactor: Move IngesterQueryRequest to data_types2
So that querier doesn't need to depend on ingester.
2022-03-02 13:52:13 -05:00
Carol (Nichols || Goulding) 8f3e44bf76
refactor: Extract a crate for shared data types in the new design 2022-03-02 12:16:15 -05:00
Carol (Nichols || Goulding) 16d86ed05b
feat: Deserialize metadata to get max_sequencer_number
And add an end-to-end test for the flight request to the ingester.
2022-03-02 11:50:47 -05:00
Carol (Nichols || Goulding) 141a6087d0
feat: Querier able to send Flight queries to Ingester
Fixes #3773.
2022-03-02 11:50:45 -05:00
Andrew Lamb 286d5f7b2b
feat: add `success` column to system.queries (#3891)
* feat: add `success` column to system.queries

* refactor: Remove lifetime from QueryCompletedToken and thread through flight

* test: update test to make incomplete query clearer

* refactor: use better patter to set complete

* fix: logical merge conflict
2022-03-02 15:05:06 +00:00
Dom Dwyer bd64f55658 feat: http ingest metrics
Records LP line count, field count & request body size (decompressed,
byte size) for writes, and request body byte size for deletes.
2022-03-02 13:05:55 +00:00
Marco Neumann af57664f53
feat: wire up flight into the querier (#3889) 2022-03-02 09:20:26 +00:00
Marko Mikulicic 39e39f92a8
fix: remove rskafka from valid options for INFLUXDB_IOX_WRITE_BUFFER_TYPE (#3890)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-01 17:29:02 +00:00
Marco Neumann 01f4d3ed3b
fix: check arrow instead of storage gRPC health for SQL REPL (#3886)
There is no reason a query pod should support the storage API. Note that
some features like the observer mode or `show databases;` still need the
management API. We'll probably need to fix that for NG at some point.
2022-03-01 15:46:02 +00:00
Marco Neumann ace4af1b66
feat: `DedicatedExecutor` async `join` and job `detach`. (#3835)
* feat: detach dedicated exec jobs

* feat: async `DedicatedExecutor::join`

Now `DedicatedExecutor` follows the system we use for other server
components:

- `shutdown`:  a quick sync call that signals the shutdown but doesn't
  drop
- `join`: async awaits until the executor has finished shutdown
- `drop`: warn but still try to shut down

* test: irmpove `detach_receiver` test

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-03-01 15:25:31 +00:00
Marco Neumann e5c45aeab6
refactor: generic top-level flight implementation (#3882)
This allows us to implement flight for the NG querier by just
implementing a few traits and reuse all the existing glue code and
optimizations (like dictionary handling).
2022-03-01 14:33:08 +00:00
Marco Neumann 48722783f9
feat: offer metrics for in-mem catalog (#3876)
This can be quite helpful to test certain caching behavior w/o writing
yet-another abstraction layer.
2022-03-01 11:33:54 +00:00
Marco Neumann 33851be3a5
chore: upgrade Rust to 1.59 (#3875)
Mostly a few new clippy crates around `flat_map`, `and_then`, and
"underscore locks" (!!!):
https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_lock

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-28 15:14:19 +00:00
Marco Neumann b213796c98
feat: sync namespaces in querier (#3865)
* feat: `NamespaceRepo::list`

* feat: sync namespaces in querier

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-28 15:01:28 +00:00
Raphael Taylor-Davies 2a842fbb1a
feat: correctly sort data and store in catalog metadata (#3864)
* feat: respect sort order in ChunkTableProvider (#3214)

feat: persist sort order in catalog (#3845)

refactor: owned SortKey (#3845)

* fix: size tests

* refactor: immutable SortKey

* test: test sort order restart (#3845)

* chore: explicit None for sort key

* chore: test cleanup

* fix: handling of sort keys containing fields

* chore: remove unused selected_sort_key

* chore: more docs

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-25 17:56:27 +00:00
Dom Dwyer 3579252682 refactor: configurable max catalog connections
Allow the maximum number of catalog (postgres) connections to be
specified as part of the catalog configuration.
2022-02-25 11:23:21 +00:00
kodiakhq[bot] a1b38b7102
Merge branch 'main' into dom/ns-cache-content-metrics 2022-02-24 16:31:09 +00:00
Luke Bond 34e06e8689
fix: compactor server stays up; removed unused delegates (#3855)
* fix: compactor server stays up; removed unused delegates

* chore: fmt

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-24 16:30:44 +00:00
Luke Bond 4731913c44
feat: skeleton of querier CLI (#3843)
* feat: skeleton of querier CLI

* chore: wrap metrics in opt&arc in querier to satisfy new api

* chore: derive debug in querier handler

* chore: add join handles and their shutdown to nascent querier server

* chore: querier server http unimpl -> 404

* fix: join/shutdown fix in querier; removed unused delegates
2022-02-24 15:42:56 +00:00
Dom Dwyer 4024e95ce9 refactor: borrow metric registry
There's no need for the namespace metrics to take (shared) ownership of
the metric registry, so lend it at the call site instead of cloning the
arc.
2022-02-24 15:04:49 +00:00
Dom Dwyer d7eda88581 refactor: early schema validation
Changes the configuration of the router request pipeline to move schema
validation before partitioning.

This reduces the concurrency of callsm into the schema validator when a
single write is split into one or more partitions, reducing contention
and cash thrashing. It also ensures we don't bother partitioning the
writes if the request will fail.
2022-02-23 18:59:14 +00:00
kodiakhq[bot] 3e69a5e1b4
Merge branch 'main' into dom/catalog-instrumentation 2022-02-23 16:14:40 +00:00
Marco Neumann 657ac249e9
feat: track ingester jobs (#3836) 2022-02-23 15:33:47 +00:00
Dom Dwyer aaf8951927 feat: instrument postgres catalog impl
Wraps the postgres implementation of the catalog with a MetricDecorator.

This is slightly intrusive, with the metrics registry being pushed into
the PostgresCatalog type in order to decorate the impls returned when
calling the Catalog::repositories() and Catalog::start_transaction()
methods (rather than being a pure decorator) in order to use static
dispatch and let the compiler optimise away as much overhead as
possible.
2022-02-23 14:34:26 +00:00
Raphael Taylor-Davies 746b18bbed
feat: allow overriding CLI request timeout (#3824)
* feat: allow overriding CLI request timeout

* chore: rename to --rpc-timeout to avoid name collision

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-23 11:35:45 +00:00
dependabot[bot] b63f920d4c
chore(deps): Bump parquet from 9.0.2 to 9.1.0 (#3828)
* chore(deps): Bump parquet from 9.0.2 to 9.1.0

Bumps [parquet](https://github.com/apache/arrow-rs) from 9.0.2 to 9.1.0.
- [Release notes](https://github.com/apache/arrow-rs/releases)
- [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apache/arrow-rs/compare/9.0.2...9.1.0)

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

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

* chore: update chunk size test

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Raphael Taylor-Davies <r.taylordavies@googlemail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-23 11:25:15 +00:00
dependabot[bot] 5a79b3a68b
chore(deps): Bump arrow-flight from 9.0.2 to 9.1.0 (#3829)
Bumps [arrow-flight](https://github.com/apache/arrow-rs) from 9.0.2 to 9.1.0.
- [Release notes](https://github.com/apache/arrow-rs/releases)
- [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apache/arrow-rs/compare/9.0.2...9.1.0)

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

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-02-23 11:03:22 +00:00
dependabot[bot] 3b7d31c88a
chore(deps): Bump arrow from 9.0.2 to 9.1.0 (#3826)
Bumps [arrow](https://github.com/apache/arrow-rs) from 9.0.2 to 9.1.0.
- [Release notes](https://github.com/apache/arrow-rs/releases)
- [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apache/arrow-rs/compare/9.0.2...9.1.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-23 09:25:46 +00:00
dependabot[bot] ad3868ed7c
chore(deps): Bump tokio from 1.16.1 to 1.17.0 (#3814)
* chore(deps): Bump tokio from 1.16.1 to 1.17.0

Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.16.1 to 1.17.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.16.1...tokio-1.17.0)

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

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

* build: update workspace-hack

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dom Dwyer <dom@itsallbroken.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-22 16:27:43 +00:00
dependabot[bot] 65ab5213e5
chore(deps): Bump clap from 3.0.14 to 3.1.1 (#3809)
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.14 to 3.1.1.
- [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/v3.0.14...v3.1.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 14:51:53 +00:00
Raphael Taylor-Davies 1960645055
feat: add wildcard support to persist partition CLI command (#3790)
* feat: add wildcard support to persist partition

* chore: fmt

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-22 14:21:06 +00:00
Raphael Taylor-Davies 0229147909
feat: preserve catalog on error (#1522) (#3802)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-22 14:10:20 +00:00
kodiakhq[bot] 326871f149
Merge branch 'main' into dom/router-handler-chain 2022-02-22 13:49:09 +00:00
Luke Bond 0f012de70c
feat: adding compactor CLI command and crate
Closes: #3777
2022-02-21 12:24:09 +00:00
Raphael Taylor-Davies 39c42678d7
feat: trigger persistence if over soft limit and no evictable chunks (#3791)
* feat: trigger persistence if over soft limit and no evictable chunks

* chore: fmt

* fix: avoid test_full_lifecycle exceeding soft limit

* fix: don't expect chunk to be unloaded

* feat: only trigger if no outstanding persist

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-21 10:14:27 +00:00
Dom Dwyer bb132b61ad refactor: chain DML handlers
The router is composed of several DML handlers called in sequence in
order to construct the full request handling pipeline. Prior to this
commit, each handler nested the next handler it calls internally,
producing a nested call chain that resulted metrics (added in #3764)
recording cumulative latency like this:

              ┌ ─

              │     ┌───────────────┐
                    │  NS Creation  │
              │     └───────────────┘
                            │  ┌───────────────┐
              │             │  │  Partitioner  │
                            │  └───────────────┘
              │             │          │
                            │          │
 Cumulative   │             │          │  ┌───────────────┐
   Timings                1.5s        1s  │    etc...     │
              │             │          │  └───────────────┘
                            │          │
              │             │          │
                            │  ┌───────────────┐
              │             │  │  Partitioner  │
                            │  └───────────────┘
              │     ┌───────────────┐
                    │  NS Creation  │
              │     └───────────────┘

              └ ─

This meant it was hard to determine the latency of a single handler
without knowing (and subtracting the latency of) all the child handlers
it calls.

This commit replaces the intrusive nested handler call chain with an
external Chain combinator type to compose together individual handlers,
resulting in correct per-handler timings and simpler code/tests:

          ┌───────────────┐
          │  NS Creation  │
          └───────────────┘
                  │
                 .5s       ┌───────────────┐
                  └───────▶│  Partitioner  │
                           └───────────────┘
                                   │
                                  1s    ┌───────────────┐
                                   └───▶│    etc...     │
                                        └───────────────┘
2022-02-18 14:19:53 +00:00
Raphael Taylor-Davies 83cba3d2fb
feat: template static router config (#3781)
* feat: template static router config

* chore: lint and improved failure output

* chore: clarify docs

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-18 10:53:10 +00:00
Marco Neumann f54ef92b77
fix: supervise and shutdown ingester background tasks (#3769)
* fix: supervise and shutdown ingester background tasks

Closes #3761.
Closes #3762.

* docs: improve wording

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

* test: join/shutdown handling for ingester

Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
2022-02-18 09:35:29 +00:00
Andrew Lamb 9588b43a90
fix: Make errors in rewriting return `Error` rather than a `panic` (#3767)
* test: add test for predicate errors

* fix: Return errors properly rather than panic

* fix: handle errors in influxrpc planner

* fix: appease clippy

* fix: tests

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-17 15:39:14 +00:00
kodiakhq[bot] c89fa3701e
Merge branch 'main' into dom/router2-metrics 2022-02-17 15:16:39 +00:00
Edd Robinson 7a2b43f1fb refactor: emit trace ID information 2022-02-16 19:01:14 +00:00
Edd Robinson e4e9b56930 feat: add support for auto-generating a query trace 2022-02-16 18:08:49 +00:00
Dom Dwyer d6d0ae8d80 feat: add instrumentation to request pipeline
Wraps the sharded write buffer, schema validator, partitioner and
overall request handler in instrumentation to record call latencies and
export them via the /metrics endpoint.
2022-02-16 14:00:49 +00:00
Dom Dwyer 92fe507e52 feat: instrumented namespace cache
Decorates the NamespaceCache with a set of cache get hit/miss counters,
and put insert/update counters to expose cache behaviour.
2022-02-16 14:00:49 +00:00
kodiakhq[bot] d0965bb0b2
Merge branch 'main' into dom/mb-partitioning 2022-02-16 11:30:42 +00:00
Paul Dix f542045485
feat: wire up persistence in ingester (#3685)
This adds persistence into the ingester with a lifecycle manager. The persist operation must still be updated to keep track of the min_unpersisted_sequence_number for each sequencer.
2022-02-16 00:13:40 +00:00
Edd Robinson 7ac9e216c4 refactor: use same log message 2022-02-15 14:36:55 +00:00
Edd Robinson 8a5ea29190 refactor: add measurement to log 2022-02-15 14:31:26 +00:00
Marco Neumann 44ee0166a0
fix: start Kafka write buffer stream at "earliest" offset, not at "0" (#3748) 2022-02-15 13:36:59 +00:00
Marco Neumann 9e7a27b344
fix: default Kafka topic name is `iox-shared` (#3747)
Do NOT use underscores in the Kafka topic because this is not supported
by Kafka. This was initially fixed by #3555 but reverted by #3623.
2022-02-15 12:34:46 +00:00
Andrew Lamb a30803e692
chore: Update datafusion, update `arrow`/`parquet`/`arrow-flight` to 9.0 (#3733)
* chore: Update datafusion

* chore: Update arrow

* fix: missing updates

* chore: Update cargo.lock

* fix: update for smaller parquet size

* fix: update test for smaller parquet files

* test: ensure parquet_file tests write multiple row groups

* fix: update callsite

* fix: Update for tests

* fix: harkari

* fix: use IoxObjectStore::existing

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-15 12:10:24 +00:00
Dom Dwyer e055800039 refactor: enable Partitioner in request pipeline
Adds the Partitioner DML handler into the handler stack, modifying the
input types of down-stream handlers to accept the partitioned data.
2022-02-15 11:34:33 +00:00
dependabot[bot] 89105ccfab
chore(deps): Bump tokio-util from 0.6.9 to 0.7.0 (#3743)
Bumps [tokio-util](https://github.com/tokio-rs/tokio) from 0.6.9 to 0.7.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-15 11:33:41 +00:00
Dom Dwyer e99922d518 refactor: parametrise DML handler input type
Allow a DML handler to specify the write input type on which it
operates.

This allows us to construct a write handler pipeline that transforms the
request as it passes through the various handlers. We'll use this to
implement a handler that annotates a normal set of table writes with the
partition key, modifying downstream handlers to expect this annotated
input.
2022-02-15 11:23:45 +00:00
Marco Neumann c6e374a025
feat: allow catalog access w/o a transaction (#3735)
* feat: allow catalog access w/o a transaction

Now the caller has the full control if they want to use a transaction or
not.

* fix: remove non-transaction-safe `create_many`

* fix: remove unnecessary transactions
2022-02-15 10:15:36 +00:00
dependabot[bot] 60a7f87645
chore(deps): Bump serde_json from 1.0.78 to 1.0.79 (#3739)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.78 to 1.0.79.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.78...v1.0.79)

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

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-02-14 20:42:54 +00:00
Raphael Taylor-Davies 26fd5273f0
feat: static database configuration (#2436) (#3732)
* feat: static database configuration (#2436)

* chore: fmt

* feat: don't base64 encode UUIDs in ServerConfigFile

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-14 19:42:49 +00:00
Raphael Taylor-Davies c79050254f
refactor: traitify database configuration (#2436) (#3730)
* refactor: traitify database configuration (#2436)

* chore: review feedback

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-13 09:26:44 +00:00
Raphael Taylor-Davies 866777ecd2
feat: static router configuration (#2436) (#3725)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-11 14:09:37 +00:00
Raphael Taylor-Davies 4e3f66ed07
feat: CLI and gRPC APIs for shutting down and restarting databases (#3720)
* feat: allow catalog wipe and rebuild whilst shutdown

* feat: CLI and gRPC APIs for shutting down and restarting databases

* feat: add ability to skip replay on restart

* fix: test_wipe_persisted_catalog_error_db_exists

* fix: wipe_preserved_catalog
2022-02-11 10:14:43 +00:00
Raphael Taylor-Davies 910f381355
refactor: require UUID to create Database (#3715)
* refactor: require UUID to create Database

* chore: review feedback

* chore: fmt

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-10 20:04:06 +00:00
Raphael Taylor-Davies b1190262b7
feat: restartable `Database` (#3368) (#3711)
* feat: restartable `Database` (#3368)

* chore: fmt

* fix: wipe_preserved_catalog

* chore: review feedback

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-10 18:32:05 +00:00
Andrew Lamb d9f331ba2a
chore: update datafusion, stop repartitioning so aggressively (#3633)
* chore: update datafusion

* fix: Update to use new datafusion api

* chore: update expected plans

* fix: support zero output partitions

* fix: update test

* fix: Update for new DataFusion API

* fix: newly added system table

* fix: update cargo lock
2022-02-09 19:53:41 +00:00
Carol (Nichols || Goulding) 73828323ac
feat: Ingester Flight gRPC API (#3623)
* feat: Add a way to run ingester with an in-memory catalog from the CLI

If you set the --catalog-dsn string to "mem", rather than using that as
a Postgres connection URL, create an in-memory catalog.

Planning on using this in tests, so not documenting.

* fix: Set default topic to the same value as SHARED_KAFKA_TOPIC

Namely, both should use an underscore. I don't think there's a way to
directly share these values between a constant and an annotation.

* feat: Add a flight API (handshake only) to ingester

* fix: Create partitions if using file-based write buffer

* fix: Change the server fixture to handle ingester server type

For now, the ingester doesn't implement the deployment API. Not sure if
it should or not.

* feat: Start implementing ingester do_get, namely decoding the query

Skip serialization of the predicate for the moment.

* refactor: Rename ingest protos to ingester to match crate name

* refactor: Rename QueryResults to QueryData

* feat: Move ingester flight client to new querier crate

* fix: Off by one error, different starting indexes in sequencers

* fix: Create new CLI argument to pick the catalog type

* fix: Create a CLI option to set the number of topics to auto-create in the write buffer

* fix: Check the arrow flight service's health to tell that the ingester gRPC is up

* fix: Set postgres as the default catalog type

* fix: Return an error rather than panicking if CLI args aren't right
2022-02-09 19:07:44 +00:00
Edd Robinson 2334e779eb feat: implement read_window_aggregate sub-command 2022-02-09 12:32:48 +00:00
Edd Robinson 0774e1d328 feat: add read_window_aggregate request builder 2022-02-09 12:32:48 +00:00
Marco Neumann 4bddab56e2
feat: create new sequencers in ingester on demand (#3671)
There is no need to introduce yet another admin action to do that. If
the sequencer does not exist yet, we can just create it and set the
`min_unpersisted_sequence_number` to 0 (which is done be `create_or_get`).
2022-02-09 12:26:30 +00:00
Edd Robinson dfa6fd8579 feat: add quiet option to storage 2022-02-08 21:27:29 +00:00
Edd Robinson 11855a5eff feat: add format flag 2022-02-08 21:15:07 +00:00
Edd Robinson c175ccd1b4
feat: make stop/stop/predicate global (#3681) 2022-02-08 20:06:47 +00:00
kodiakhq[bot] ace76cef14
Merge branch 'main' into dom/sharded-cache 2022-02-08 16:09:48 +00:00
Paul Dix 59b2141c0b
feat: Add lifecycle manager to ingester (#3645)
This adds the lifecycle manager to the ingester. It will trigger based on a threshold for max partition size or age or based on keeping total memory under a certain threshold.

It defines a new interface for a persister, which is stubbed out for IngesterData. I'm not sure yet how persistence errors should be handled. The assumption here is that the persister continues to retry persistence forever until it succeeds.

There is one scenario I can think of that may cause this lifecycle manager problems. If a single partition is very high throughput, it could cause things to back up as persistence is not parallelized within a single partition. Any given partition can currently only run one persistence operation at a time. We can address this later.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-08 15:23:40 +00:00
Marco Neumann 5de4d6203f
refactor: catalog transaction (#3660)
* refactor: catalog Unit of Work (= transaction)

Setup an inteface to handle Units of Work within our catalog. Previously
both the Postgres and the in-mem backend used "mini-transactions on
demand". Now the caller has a clear way to establish boundaries and
gets read and write isolation. A single `Arc<dyn Catalog>` can create as
many `Box<dyn UnitOfWork>` as you like, but note that depending on the
backend you may not scale infinitely (postgres will likely impose
certain limits and the in-mem backend limits concurrency to 1 to keep
things simple).

* docs: improve wording

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

* refactor: rename Unit of Work to Transaction

* test: improve `test_txn_isolation`

* feat: clearify transaction drop semantics

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-08 13:38:33 +00:00
kodiakhq[bot] 4567800901
Merge branch 'main' into er/feat/tag_values_cli 2022-02-08 13:07:59 +00:00
Raphael Taylor-Davies be662ec731
feat: lazy query log! (#3654)
* feat: lazy query log

* chore: fmt

* chore: review feedback

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-08 13:07:28 +00:00
Edd Robinson 6c10e1e901 feat: support _measurement/_field tag keys 2022-02-08 11:32:28 +00:00
Edd Robinson eb733042ca feat: add support for tag_values cli 2022-02-07 22:02:29 +00:00
Edd Robinson 38a889ecf6 refactor: remove unnecessary struct 2022-02-07 22:02:29 +00:00
Marco Neumann d9cc9f5a2a
feat: expose write buffer connection config via CLI (#3651)
* feat: improve rskafka config error messages

* feat: expose write buffer connection config via CLI
2022-02-07 16:24:28 +00:00
Marco Neumann 977ccc1989
fix: use a single metric registry for ingester (#3652)
With this change write buffer ingestion metrics are showing up under
`/metrics`

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-07 15:56:54 +00:00
Edd Robinson 87ac926e06
feat: add queries system table (#3655)
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
2022-02-07 15:26:06 +00:00
Carol (Nichols || Goulding) 2e30483f1f
refactor: Remove predicate module from predicate crate (#3648)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-07 14:54:07 +00:00
Marco Neumann e2db1df11f
refactor: improve writer buffer consumer interface (#3631)
* refactor: improve writer buffer consumer interface

The change looks huge but is actually rather simple. To
understand the interface change, let me first explain what we want:

- be able to fetch watermarks for any sequencer
- have streams:
  - each streams tracks a sequencer and has an offset state (no read
    multiplexing)
  - we can seek a stream
  - seeking and streaming cannot be done at the same time (that would be
    weird and likely leads to many bugs both in write buffer and in the
    user code)
- ideally we don't need to create streams of all sequencers but can
  choose a subset

Before this change we had one mutable consumer struct where you can get
all streams and watermark functions (this mutable-borrows the consumer)
or you can seek a single stream (this also mutable-borrows the
consumer). This is a bit weird for multiple reasons:

- you cannot seek a single stream without dropping all of them
- the mutable-borrow construct makes it really difficult to pass the
  streams into separate threads
- the consumer is boxed (because its mutable) which makes it more
  difficult to handle in a large-scale application

What this change does is the following:

- you have an immutable consumer (similar to the producer)
- the consumer offers the following methods:
  - get the set of sequencer IDs
  - get watermark for any sequencer
  - get a stream handler (see next point) for any sequencer
- the stream handler captures the stream state (offset) and provides you
  a standard `Stream<_>` interface as well as a seek function.
  Mutable-borrows ensure that you cannot use both at the same time.

The stream handler provides you the stream via `handler.stream()`. It
doesn't implement `Stream<_>` itself because the way boxing, dynamic
dispatch work, and pinning interact (i.e. I couldn't get it to work
without the indirection).

As a bonus point (which we don't use however) you can now create
multiple streams for the same sequencer and they all have their own
offset.

* fix: review comments

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

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-02-07 12:24:17 +00:00
Edd Robinson a52c0a26e6 feat: print read filter results 2022-02-04 22:14:22 +00:00
Edd Robinson d328b37803 feat: teach IOx to convert RPC frames into Recordbatches 2022-02-04 18:34:54 +00:00
Edd Robinson 4cdaaf96bf refactor: clean up errors 2022-02-04 18:34:54 +00:00
Edd Robinson ea0ece8b4b feat: issue read_filter request 2022-02-04 18:34:54 +00:00
Dom Dwyer 0b044b95fb perf: use sharded namespace cache
Enables the ShardedCache for the namespace schema cache.
2022-02-04 16:12:51 +00:00
Dom Dwyer 026a557c0b refactor: rename TableNamespaceSharder
Rename to JumpHash and expose the hashing internals for reuse (outside
of only table & namespace sharding).
2022-02-04 15:56:09 +00:00
Dom Dwyer 0fd122e365 refactor: "inf" retention const
Adds the iox_catalog::INFINITE_RETENTION_POLICY constant.
2022-02-04 15:35:33 +00:00
Dom Dwyer f1ba50f40b feat: resolve query pool ID at startup
This commit adds a --query-pool flag to router2, used to upsert a
catalog record at startup. Auto-created namespaces will reference this
query pool.

This is for testing only and will be removed in a future commit.
2022-02-04 15:35:30 +00:00
Dom Dwyer aefc70a9ea feat(router2): namespace auto-creation
Decorate the existing request handler pipeline with a layer that
implicitly creates the namespace when a write request is received.
2022-02-04 15:34:15 +00:00
Marco Neumann 0c01044677
fix: partition range in ingester CLI has INCLUSIVE end (#3641) 2022-02-04 13:41:57 +00:00
Marco Neumann d2ccf23263
fix: use standard DSN argument for router2 CLI (#3632)
- support long-form (instead of relying on positional arguments)
- use same code as everying else

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-03 17:20:52 +00:00
Markus Westerlind 0bd7941a18
fix(REPL): Don't buffer lines until a trailing semicolon is found and add history hinting (#3630)
* fix(REPL): Don't buffer lines until a trailing semicolon is found

The repl would silently buffer all lines until a trailing semicolon were found which
resulted in some very confusing error messages as I would input invalid commands followed
by a command I thought were valid, except I'd still get an error due to the previous command being buffered.

This uses rustyline's helper feature to detect incomplete input (no trailing semicolon) and makes
it accept multiline input until the input is completed.

I also included some of rustyline's default hint and highlighting while I was at it.

* chore: cargo clippy

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-03 17:11:01 +00:00
Marco Neumann b3b2d9b623
feat: catalog setup CLI command (#3627)
Closes #3509.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-03 14:16:21 +00:00
Andrew Lamb ab3c7573f5
test: add end to end for read_filter and empty string predicates (#3619)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-03 14:05:32 +00:00
Marco Neumann 50cff27b01
chore: remove rdkafka dependency (#3625)
All features are now covered by rskafka. This also removes the need to
specify a server ID for write buffer consumers. This was only used for
rdkafka since there we needed to specify a consumer group, even though
we did not use any transactions.
2022-02-03 13:33:56 +00:00
kodiakhq[bot] 3197ea945b
Merge branch 'main' into dom/extract-ns-cache 2022-02-03 12:30:37 +00:00
Andrew Lamb 77b80e7618
fix(InfluxQL): treat null tags as `''` rather than `null` in storagerpc queries (#3557)
* fix(InfluxQL): treat null tags as `''` rather than `null` in storage rpc queries

* test: add one more case

* fix: Update comment

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

Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-03 12:14:43 +00:00
Paul Dix ce46bbaada
feat: wire up the write buffer to the ingester process (#3533)
This adds the scaffolding for the ingester server to consume data from Kafka. This ingests data in an in memory structure while creating records in the catalog for any partitions that don't yet exist.

I've removed catalog_update.rs in ingester for now. That was mostly a placeholder and will be going in a combination of handler.rs and data.rs on my next PR which will have some primitive lifecycle wired up.

There's one ugly bit here where the DML write is cloned because it's getting borrowed to output spans and metrics. I'll need to follow up with a refactor to make it so that the DML write's tables can be consumed without it gumming up the metrics stuff.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-03 11:47:28 +00:00
Dom Dwyer 3cc4481616 refactor: extract NamespaceSchema cache
Breaks the in-memory cache of NamespaceSchema out into a decoupled type
that can be shared across multiple DML handlers.
2022-02-03 10:01:07 +00:00
Carol (Nichols || Goulding) a534136ccc
fix: Correct a 'long' argument name so the ingester command can run (#3621)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-02 20:09:41 +00:00
Andrew Lamb 429d59f1b6
feat: Simplify predicates in the `InfluxRpcFrontend` before using them (#3588)
* feat: normalize + simplify RPC predicates before using them

* docs: Update predicate/src/rpc_predicate.rs

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-02 19:46:57 +00:00
kodiakhq[bot] 6de8ed4adc
Merge branch 'main' into dom/schema-validation 2022-02-02 16:05:41 +00:00
Luke Bond 6da15d9690 chore: cleanup catalog CLI output & args
Co-authored-by: Marco Neumann <marco@crepererum.net>
2022-02-02 15:30:19 +00:00
Luke Bond 15827a534b feat: catalog CLI command with update subcommand 2022-02-02 15:30:19 +00:00
Dom Dwyer 39d489d9e7 refactor: enable schema validation
Adds the SchemaValidator to the DML handler stack - this adds it into
the request path in router2.
2022-02-02 14:04:14 +00:00
Edd Robinson 5441682207 feat: add support for parsing predicate 2022-02-02 11:02:33 +00:00
Edd Robinson 08901c13cd feat: support parsing timerange 2022-02-02 11:02:33 +00:00
Edd Robinson a424d1c912 feat: shell command read_filter 2022-02-02 11:02:33 +00:00
Marco Neumann 59a2c74352
refactor: reusable ingester/router2 CLI pieces (#3590)
* refactor: use a single CLI parser for ingester/router2 WB

* refactor: reusable catalog DSN CLI handling

We are going to need DSN handling for the router as well as for the some
admin tools.

* fix: DNS -> DSN
2022-02-01 12:57:58 +00:00
Marco Neumann 22778a3a80
chore: upgrade rskafka and parking_lot (#3592) 2022-02-01 11:50:42 +00:00
Marco Neumann b326b62b44
feat: buffer writes when writing to RSKafka (#3520) 2022-02-01 10:07:52 +00:00
Carol (Nichols || Goulding) c633c9bc5c
feat: Wire object store into ingester persistence 2022-01-31 10:36:30 -05:00
Marco Neumann c50fc8764d
feat: basic non-panic HTTP/gRPC interface for ingester (#3583)
Don't panic when K8s requests a health status or someone requests a
non-found HTTP route; or when we just TRY to start up the gRPC service.
2022-01-31 11:13:14 +00:00
Andrew Lamb 36642eb71d
test: add end to end tests that query missing tags (#3563)
* test: add end to end tests that query missing tags

* fix: add github reference

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-28 18:42:57 +00:00
Marco Neumann 3659a7f799
refactor: clean up ingester CLI (#3569)
- use same args/envs names as router2 does
- kafka => write buffer
- add long forms to all CLI args so we don't have to pass positional
  arguments

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-28 17:58:16 +00:00
Raphael Taylor-Davies 4101d16f71
chore: feature flag consistency (#3574)
* chore: feature flag consistency

* chore: add aarch64-apple-darwin to hakari

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-28 16:38:59 +00:00
Marco Neumann a22ca7c3d7
fix: router2 writer buffer topic (#3555)
- Kafka does not support `_` in topic names, but `-` works, so let's
  change the default
- Expose topic config via CLI/env
2022-01-28 10:10:04 +00:00
Andrew Lamb f24ce03754
fix: provide correct environment variable to change log filter (#3561)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-27 20:45:06 +00:00
Andrew Lamb 2062267d0f
chore: Update hashbrown (#3551)
* chore: Update hashbrown

* fix: hakari

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-27 15:34:10 +00:00
Dom 5447554aee
refactor(router2): DML handler stack (#3549)
* refactor: composable DmlHandler stack

Changes the DmlHandler trait to allow composition of handler logic in
order to construct the complete request processing pipeline.

* feat: debug log write/delete requests

Log requests hitting the HTTP endpoint at DEBUG.

* refactor: dml_handler -> dml_handlers

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-27 14:54:27 +00:00
Raphael Taylor-Davies 21c1824a7a
refactor: remove table_names from Predicate (#3545)
* refactor: remove table_names from Predicate

* chore: fix benchmarks

* chore: review feedback

Co-authored-by: Edd Robinson <me@edd.io>

* chore: review feedback

* chore: replace Default::default with InfluxRpcPredicate::default()

Co-authored-by: Edd Robinson <me@edd.io>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-27 14:44:49 +00:00
Paul Dix 16d584b2ff
feat: Add db_name/namespace to DmlWrite and DmlDelete (#3531)
* feat: Add db_name/namespace to DmlWrite and DmlDelete

This is required for the new ingester to be able to work with the write buffer. The protobuf that gets serialized over Kafka already includes the database name, it just wasn't getting carried through to the marshaled Dml operation.

* fix: database != namespace, propagation through write buffer

Co-authored-by: Marco Neumann <marco@crepererum.net>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-27 14:12:20 +00:00
Andrew Lamb 5488c257d1
chore: Update datafusion, upgrade to arrow/parqet/arrow-flight 8.0.0 (#3517)
* chore: Update datafusion

* chore: update to arrow 8

* fix: update to use new DataFusion APIs

* fix: update case for sortedness

* fix: cargo hakari
2022-01-27 13:33:27 +00:00
Luke Bond 107f39d53c
feat: add trace collector to router2 (#3529)
* feat: add trace collector to router2

* chore: fmt
2022-01-26 11:51:17 +00:00
Dom 6b0f7e6b2b
feat: initialise ShardedWriteBuffer (#3528)
Initialises a ShardedWriteBuffer for the hard-coded "iox_shared" topic.

Adds the following CLI flags:

    * --write-buffer: type of buffer [kafka, rskafka, file]
    * --write-buffer-addr: write buffer endpoint address

The server uses these config options to initialise the appropriate write
buffer backend, and configure the TableNamespaceSharder to shard
operations over the set of sequencers exposed by the write buffer.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-26 10:49:34 +00:00
Raphael Taylor-Davies 1b6aed063d
feat: add per-partition tracing (#3532)
* feat: add per-partition tracing

* chore: docs

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-26 10:39:21 +00:00
Raphael Taylor-Davies db46ac04d0
feat: support line protocol precision parameter (#3522) (#3526)
* feat: support line protocol precision parameter (#3522)

* chore: format imports

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-25 14:12:22 +00:00
Paul Dix bb893510a0 feat: Add scaffolding for ingester server
* Adds a new ingester command to start an ingester server
* Moves previous ingester server over to handler
* Skeleton for gRPC and HTTP handlers
2022-01-21 18:02:19 -05:00
Andrew Lamb 9c19cd6cc4
fix: clamp start/end of TimestampRange to min/max valid timestamp values (#3487)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-20 16:08:00 +00:00
Andrew Lamb 9751301374
refactor: rename `storage_api.rs` end to end test to `influxrpc.rs` for consistency (#3497)
* refactor: rename `storage_api` end to end test to `influxrpc`  for consistency

* fix: fmt
2022-01-20 14:25:13 +00:00
Marco Neumann 168afb63ad feat: add `size` methods to DML-related types
This will be helpful when we want to batch DML operations in memory
(e.g. when using RSKafka).

This also ensures that `MBChunk` accounts for the column names that
are stored within `MutableBatch`.
2022-01-18 13:52:31 +01:00
Dom 40a290f6f7 feat: router2 HTTP handlers
Implements the HTTP v2 write API endpoint for router2.
2022-01-17 11:57:28 +00:00
Marco Neumann c399e676ca chore: upgrade clap to v3 2022-01-17 12:12:46 +01:00
Raphael Taylor-Davies 89db894df4
fix: serde_json `arbitrary_precision` (#3458) (#3469)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-17 09:50:54 +00:00