Commit Graph

656 Commits (3769ad3d216f9f5eeb38d414f661d80d763e197c)

Author SHA1 Message Date
Andrew Lamb c672bb341d
feat: Extract SQL planning out of databases (#618) 2021-01-07 13:13:30 -05:00
Paul Dix d17ef800c5
feat: add create and get database to API (#619)
* feat: add create and get database to API

This commit is start of the IOx specific API. It puts everything under /iox/api/v1 as this is the beginning of the IOx API. Creating a database is done with a PUT and a GET request can retrieve the DatabaseRules details.

* feat: add defaults for DatabaseRules for create_database

* feat: add create and get database to API

This commit is start of the IOx specific API. It puts everything under /iox/api/v1 as this is the beginning of the IOx API. Creating a database is done with a PUT and a GET request can retrieve the DatabaseRules details.
2021-01-07 12:25:37 -05:00
Carol (Nichols || Goulding) 18ee1b561b feat: Use ObjectStorePath everywhere to feel out the API needed 2021-01-07 10:48:22 -05:00
Paul Dix d1ab5c0ee9 chore: refactor object_store crate
This pulls the different backing implmenetations into their own modules. They're about to get more complex so it felt like it was time to separate them out rather than building towards a single multi-thousand line lib.rs. The error type is only defined in lib and imported by the individual modules, which I think makes it easier to work with.
2021-01-07 09:19:07 -05:00
Andrew Lamb 654b520005
feat: Interface for writing and querying mutable buffer, read buffer and parquet (#615)
* refactor: Create database with mutable buffer, read buffer and parquet files

* docs: Apply suggestions from code review

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

* fix: rename planners to clarify what they are

* refactor: simplify traits

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2021-01-06 17:25:46 -05:00
Andrew Lamb 9f0ff678f1
feat: Formalizes the config system for IOx, including tests (#608)
* feat: Create configuration system, port IOx to use it

* docs: Apply suggestions from code review

Co-authored-by: Paul Dix <paul@influxdata.com>

* fix: fix test for setting values

Co-authored-by: Paul Dix <paul@influxdata.com>
2020-12-31 07:02:31 -05:00
Andrew Lamb 5fa77c32cc
feat: Add "Chunks" to the Mutable Buffer (#596)
* refactor: Update docs, remove unused field

* refactor: rename partition -> chunk

* feat: Introduce new partition, which is a holder for Chunks

* refactor: Remove use of wal from mutable database

* refactor: cleanups, remove last direct use of chunks

* fix: delete old benchmarks

* fix: clippy sacrifice

* docs: tidy up comments

* refactor: remove unused error types

* chore: remove commented out tests
2020-12-28 07:10:25 -05:00
Paul Dix b998a916b3 chore: update http API with more logging and better error hanlding 2020-12-24 16:45:23 -06:00
Paul Dix 1d200c5c77 chore: move http API over to Routerify
This moves the HTTP API over to Routerify, which has the basic route parsing logic that will enable the API design for IOx.

I had a little trouble with the error handling in Routerify so I ended up creating a macro for constructing error responses in the HTTP API. I'm not sure what I think of this pattern so I'm interested in what others think. Another option would be to have two functions for each API endpoint. One which is x_handler with a Routerify function signature. Then another which is just x that has the Result<Response<Body>, ApplicationError> return type, which would make using the ? operator work in those functions. That would eliminate the need for the return_err macro.

I'm happy to refactor to that if people prefer it.
2020-12-24 16:45:20 -06:00
Andrew Lamb 48c43b136c
refactor: rename write_buffer --> mutable_buffer (#595)
* refactor: git mv write_buffer mutable_buffer

* refactor: update crate name references

* refactor: update some more references
2020-12-22 10:49:53 -05:00
Andrew Lamb 163f34c27b
feat: report support for read_group in capabilities request (#586) 2020-12-22 10:06:48 -05:00
Andrew Lamb 263af1eeac
feat: implement read_group in the write_buffer (#583)
* feat: implement read_group in the write_buffer

* fix: Apply suggestions from code review

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

* fix: rustfmt

* fix: adjust tests for min/max

* fix: Update write_buffer/src/table.rs

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

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-12-22 09:03:20 -05:00
Andrew Lamb e96d309a5e
fix: do not error in gRPC if a Group::By is specified with no group columns (#593) 2020-12-21 11:49:52 -05:00
Andrew Lamb ea1e47a71e
chore: tweak logging messages (#592)
* chore: tweak logging messages

* chore: Include log message in error logging
2020-12-21 11:39:04 -05:00
Paul Dix 70ff4267ce
chore: Connect server crate to http routes and server command (#569)
* chore: Connect server crate to http routes and server command

This updates the http_routes and main server to use the Server crate. This is the first step in a larger effort to start hooking up the initial IOx API and get things running end to end with in-memory database, WAL buffer, and object storage.

For the time being, this disables the previous disk based WAL. Or rather, it uses the WriteBufferDb without it. That means that this IOx server has no persistence until later. Because of this, the restart in the end-to-end was removed.

Later PRs will add the WAL buffer and restart logic that loads from object store. We can opt to bring the local disk based WAL back later, but it will likely require some refactoring to work with how the WAL Buffer will operate.
2020-12-17 18:48:41 -05:00
Andrew Lamb 1740e26ec3
fix: do not produce gRPC series frames for fields that only contain null values (#558)
* test: add test for field columns with only nulls

* fix: do not produce series for null fields, tests for same

* fix: remove uneeded test printlns
2020-12-15 08:28:23 -05:00
Dom 667b2595d9 refactor: use expect for tracing unwrap 2020-12-14 12:06:53 +00:00
Dom 21110dc233 style: prefer is_ok()
Co-authored-by: Edd Robinson <me@edd.io>
2020-12-14 12:06:53 +00:00
Dom 9d7389dec2 feat(tracing): add Jaeger tracing sink
Adds telemetry / tracing with support for a Jaeger backend, and changes the
logger from env_logger to a tracing subscriber to collect the log entries.

Events are batched and then emitted asynchronosuly via UDP to the Jaeger
collector using the tokio runtime. There's a bunch of settings (env
vars) related to batch sizes and flush frequency etc - they're all using
their default values at the moment (if it ain't broke...) See the docs
for more info:

    https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/sdk-environment-variables.md#opentelemetry-environment-variable-specification

This is only part 1 of telemetry - it does NOT propagate traces across RPC
boundaries as we're still defining how all this should work. I've created #541
to track this.

Closes #202 and closes #203.
2020-12-14 12:06:52 +00:00
Dom 6f473984d0 style: wrap comments
Runs rustfmt with the new config.
2020-12-11 18:22:26 +00:00
Andrew Lamb d47acfa3b5
fix: better read_group input validation checking: group and hints fields (#539)
* fix: Error if hint argument is provided to read_groupg

* fix: Verify compatible group and group_keys settings

* docs: Add clarifying comments on validation

* refactor: use into() rather than String::from for consistency
2020-12-11 11:33:21 -05:00
Dom 6513e2b056 fix: never uninstall panic handler
Fixes #548
2020-12-10 17:16:10 +00:00
Andrew Lamb 50ba529cb8
test: Adds tests for read_group for None aggregates (#538) 2020-12-10 11:31:15 -05:00
huming a5a3cd149d chore: some minor comments and rename 2020-12-10 10:48:57 +08:00
Paul Dix fa3ecbd4ed
feat: Implement write buffer to Parquet snapshotting (#526)
* feat: Implement write buffer to Parquet snapshotting

This introduces snapshot to the server packages to manage snapshotting. It also introduces a new trait for representing a Partition. There is a very crude API wired up in http_routes for testing purposes. Follow on work will bring the server package into http_routes and rework the snapshot API.
2020-12-08 14:20:43 -05:00
Dom ceea61a211
Merge branch 'main' into dom/org-bucket-types 2020-12-04 11:33:36 +00:00
Andrew Lamb 4ec75a4f22
fix: Fix gRPC panic` when multiple field selections are provided (#523)
* fix: do not assert when multiple fields are selected

* fix: clippy

* fix: write unit test, fix bug

* fix: tweak comments
2020-12-03 12:31:02 -05:00
Dom 87573256a7 chore: fmt 2020-12-03 16:10:16 +00:00
Dom d96ed66c32 refactor: clearer lifetime for org&bucket mapping
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-12-03 16:10:16 +00:00
Dom 234df612ec refactor: avoid clones for errors
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-12-03 16:10:16 +00:00
Dom 59f9665438 test: cover org_and_bucket_to_database 2020-12-03 16:10:16 +00:00
Dom f90a95fd80 fix: unambigious bucket/org to DB mappings
Previosuly the $ORG and $BUCKET was joined as:

	$ORG + "_" + $BUCKET

Which is fine unless either $ORG or $BUCKET includes a "_", such as:

	$ORG = "org_a"
	$BUCKET = "bucket"

	and

	$ORG = "org"
	$BUCKET = "a_bucket"

This change continues to join $ORG and $BUCKET with an underscore, but
disallows underscores in either $ORG or $BUCKET. It appears these values
are non-zero u64s in the gRPC protocol converted to their base-10 string
representations for the DB name, so this seems safe to enforce.

In addition, this change introduces a `DatabaseName` type to avoid
passing bare strings around, and allow consuming code to ensure only
valid database names are provided at compile type. This type works with
both owned & borrowed content so doesn't force a string copy where we
can avoid it, and derefs to `str` to make it easier to use with existing
code.

I've been minimally invasive in pushing the `DatabaseName` through the
existing code and figured I'd see what the sentement is first.
Candidates for conversion from `str` to `DatabaseName` that seem to make
sense to me include:

	- `DatabaseStore` trait
	- `RemoteServer` trait
	- Others? Basically anywhere other than the "edge" API inputs

Fixes #436 (thanks @zeebo)
2020-12-03 16:10:15 +00:00
Andrew Lamb 8c0e14e039
refactor: rename src/server/rpc/storage.rs to src/server/rpc/service.rs (#513)
* refactor: rename src/server/rpc/storage.rs src/server/rpc/service.rs

* refactor: update references
2020-12-03 09:59:00 -05:00
Andrew Lamb 8cb8276819
fix: Update gRPC definitions so tag_key=_field requests work in IOx (#517)
* fix: Update gRPC definitions so tag_key=_field requests work in IOx

* docs: Update src/server/rpc.rs

* fix: fixup test

* fix: Apply suggestions from code review

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

* fix: consistent type annotations

* fix: refactor redundant test code into test_helpers

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-12-02 13:58:48 -05:00
Andrew Lamb ecc4eee8e1
refactor: Move SQL functions into is own trait (#511)
* refactor: remove uneeded function table_to_arrow from Trait

* refactor: Move SQL functions into is own trait
2020-12-02 08:23:37 -05:00
Andrew Lamb c99d389a70
refactor: Remove vestigial gRPC IOX API (#508)
* refactor: remove unused IOx gRPC interface

* refactor: rename file

* refactor: rename gRPC service IOx to IOxTesting
2020-12-02 06:55:15 -05:00
Andrew Lamb 5ef499bb63
refactor: rename Database --> TSDatabase to better reflect its purpose (#510)
* refactor: rename Database --> TSDatabase to better reflect its purpose

* refactor: rename field_columns to field_column_names

* fix: clippy?
2020-12-01 12:37:11 -05:00
Andrew Lamb a2e5af1508
feat: Log gRPC predicates in a human readable form (#507)
* feat: log predicate passed to storage system

* fix: clippy
2020-12-01 09:31:39 -05:00
Dom c3a0e893ae test: use flate2 2020-12-01 11:01:10 +00:00
Andrew Lamb 1646397891
refactor: consolidate GroupedSeriesSet and SeriesSet (#502) 2020-11-30 14:23:58 -05:00
Dom 19b0ff284d chore(server): restrict gzip deflated body size
Restricts the size of the decompressed request body when using gzip.
2020-11-30 15:20:20 +00:00
Dom 867aba847a perf(convert): use flate2 for gzip decompression
Switches from `libflate` to `flate2` for the top-level commands (specifically
TSM conversion).
2020-11-30 15:18:25 +00:00
Andrew Lamb 46d58dfec5
fix: allow empty `offset` widows for read_window_aggregate offset (#493)
* fix: allow empty `offset` widows for read_window_aggregate offset

* refactor: Use an enum for clarity
2020-11-27 09:31:22 -05:00
Andrew Lamb 129aa208ba
refactor: More use of datafusion expr building functions (#488) 2020-11-26 06:40:57 -05:00
Dom aca65414c7
Merge pull request #492 from influxdata/alamb/moar-logging
feat: Log error message returned to gRPC in IOx logs
2020-11-26 11:25:18 +00:00
Dom 9c726530ed
Merge pull request #489 from influxdata/dom/storage-fixture-random-port
test: random ports for storage fixture server
2020-11-26 10:04:11 +00:00
Andrew Lamb f825e01699 feat: log gRPC errors 2020-11-25 17:11:38 -05:00
Andrew Lamb 3a9ee88f00
chore: update to latest version of arrow + update code (#486)
* chore: update to latest version of arrow + update code

* chore: Update rust toolchain to match arrow

* fix: clippy
2020-11-25 14:46:35 -05:00
Dom 49fe88fced test: random ports for storage fixture server
Rather than having to specify unique ports for test server instances, have the
kernel randomly assign ports and configure the storage gRPC client to use them.
2020-11-25 17:41:36 +00:00
Andrew Lamb c08744603b
refactor: Remove uneeded unwrap (#482) 2020-11-25 06:44:15 -05:00
Andrew Lamb 9f6427c94f
refactor: query/src/groupby.rs -> query/src/group_by.rs (#477)
* refactor: query/src/groupby.rs -> query/src/group_by.rs

* refactor: update references
2020-11-25 06:43:11 -05:00
Andrew Lamb cdb26e60e4
refactor: rename `storage` crate to `query` to better reflect what it is (#475)
* refactor: rename storage --> query

* refactor: update a few more referenes
2020-11-24 14:19:29 -05:00
Andrew Lamb 85921fe401
feat: Implement gRPC and storage interface for read_group_aggregate (#474)
* feat: Implement gRPC and storage interface for read_group_aggregate

* fix: clippy

* docs: Tweak comments

* fix: moar clippy

* fix: fmt

* docs: Apply doc improvement suggestions from code review

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

* refactor: improve error creation

* refactor: use match instead of if

* refactor: clearer match

* refactor: clean up storage aggregate matching

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-11-24 13:41:11 -05:00
Andrew Lamb e1403479c7
refactor: rename historically named write_buffer_server (#467)
* refactor: rename historically named write_buffer_server

* fix: fmt
2020-11-20 16:14:51 -05:00
Andrew Lamb fe663c3534
feat: add cpu_feature_check (#458)
* feat: add cpu_feature_check

* fix: clarify output
2020-11-17 13:28:23 -05:00
Andrew Lamb 597933622d
fix: improve error messages with more context (#455) 2020-11-16 16:40:29 -05:00
Andrew Lamb 831a0875d6
chore: update to latest arrow + Rust nightly-2020-11-14 (#454)
* chore: update to latest arrow + Rust nightly-2020-11-14

* chore: update ci

* fix: update for clippy lints

* fix: Allow redundant_field_names in generated types crate

* fix: clippy about try_for_each

* fix: clippy uneeded-collect

* fix: clippy about default values

* fix: clippy mathces --> matches!

* fix: clippy sort --> sort_by_key

* fix: clippy about default values again
2020-11-16 11:48:42 -05:00
Arve Knudsen cc6394d68a
fix: return error from binding HTTP server address instead of panicking (#453)
Signed-off-by: Andrew Lamb <alamb@influxdata.com>
2020-11-16 10:59:47 -05:00
Andrew Lamb 87626a3635
feat: Update storage protobuf definitions, add stubs for read_window_aggregate (#444)
* feat: Update storage protobuf definitions, add stubs for read_window_aggregate

* refactor: Extract the features field in a clearer way

* docs: Add provenance information to service.proto
2020-11-12 07:07:42 -05:00
Andrew Lamb 659da9264a
chore: Update predicate protobuf definitions (#443) 2020-11-11 18:06:39 -05:00
Andrew Lamb 33f3ca8b6d
feat: Print message to stdout when the server is read (#432) 2020-11-11 06:41:54 -05:00
Andrew Lamb 141527425d
fix: log errors from spawned tokio async tasks (#423) 2020-11-10 16:54:26 -05:00
Carol (Nichols || Goulding) 05b60b8fd0 fix: Remove remaining mentions of Delorean 2020-11-10 11:47:42 -05:00
Carol (Nichols || Goulding) d7789d5cac fix: Create the database directory if it doesn't already exist 2020-11-10 11:32:58 -05:00
Andrew Lamb 5bb530ccc6
refactor: rename tsm --> influxdb_tsm (#418) 2020-11-05 14:35:38 -05:00
Andrew Lamb b745a180a4
refactor: rename delorean --> InfluDB IOx (#417) 2020-11-05 13:51:04 -05:00
Andrew Lamb a52e0001c5
refactor: rename all crates that start with`delorean_` in preparation for rename (#415)
* refactor: rename delorean_cluster --> cluster

* refactor: rebane delorean_generated_types --> generated_types

* refactor: rename delorean_write_buffer --> write_buffer

* refactor: rename delorean_ingest --> ingest

* refactor: rename delorean_storage --> storage

* refactor: rename delorean_tsm --> tsm

* refactor: rename delorean_test_helpers --> test_helpers

* refactor: rename delorean_arrow --> arrow_deps

* refactor: rename delorean_line_parser --> influxdb_line_protocol
2020-11-05 13:44:36 -05:00
Andrew Lamb 4f348836fe
refactor: remove delorean_parquet by compining with delorean_ingest (#412) 2020-11-05 09:29:59 -05:00
Andrew Lamb 8399d2a159
refactor: rename delorean_table to packers (#409) 2020-11-05 08:52:22 -05:00
Andrew Lamb 075ba0d8d1
refactor: remove delorean_table_schema crate and fold it into data_types (#408) 2020-11-05 06:17:20 -05:00
Andrew Lamb c1abc90672
feat: Add support for gRPC tag and field references (#405) 2020-11-05 06:04:01 -05:00
Andrew Lamb 525e34bde9
feat: Support non utf8 tag keys, and pattern matching for InfluxQL generated predicates (#404)
* feat: Allow binary tag references in gRPC, predicate matching patterns

* feat: New predicate format and builder

* fix: Update to work with branches

* test: Add test coverage for rpc predicate conversion

* refactor: use From trait

* refactor: make logic more idomatic

* refactor: remove spurious log message

* fix: Apply suggestions from code review

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

* refactor: use TryFrom trait

* fix: make it compile again

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-11-04 17:09:04 -05:00
Andrew Lamb 9f36914351
chore: Upgrade version of Arrow / DataFusion (3 of 3) + update code for new interfaces (#395) 2020-11-02 11:20:44 -05:00
Andrew Lamb 6623ce9f65
feat: Add more logging for rpc, reduce low level hyper logging (#396) 2020-10-27 11:24:44 -04:00
Andrew Lamb 2083b41a24
refactor: rename write_buffer* to take its rightful place (#392) 2020-10-26 16:31:34 -04:00
Andrew Lamb ef501871bb
feat: remove partition_store (#387) 2020-10-26 14:39:38 -04:00
Andrew Lamb 4e1e8dbf79
chore: Upgrade version of Arrow/DataFusion (2 of 3) (#391)
* chore: Upgrade version of Arrow/DataFusion (2 of 3)

* fix: Fixup error type usage and use async stream interface

* fix: post merge fixups
2020-10-26 13:49:16 -04:00
Andrew Lamb 880958d9c7
feat: switch end-to-end test to use write_buffer implementation rather than partitioned store (#386)
* feat: switch end-to-end test to use write_buffer implementation rather than partitioned store

* fix: Apply PR suggestions
2020-10-26 13:42:38 -04:00
Andrew Lamb a66bd4a738
feat: Implement measurement_fields gRPC route (#384)
* feat: Implement measurement_fields gRPC route

* fix: Apply suggestions from code review in github

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

* fix: apply code review comments locally

* fix: fix based on code review

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
2020-10-23 14:01:46 -04:00
Andrew Lamb 0b443fdb12
feat: add --num-threads CLI argument, allow single threaded operation (#378) 2020-10-21 17:12:32 -04:00
Andrew Lamb 53b529fe19
refactor: Remove some uses of pub use (#377)
* refactor: Remove some uses of pub use

* fix: remove bad comment
2020-10-21 06:38:38 -04:00
Andrew Lamb b0f0f2743b
feat: Convert GroupedSeriesSetItems to GroupFrame (#368) 2020-10-21 06:13:37 -04:00
Andrew Lamb bfb966b1f1
feat: basic read_group plumbing (#365)
* feat: basic read_group plumbing

* fix: Update delorean_storage/src/exec.rs
2020-10-19 11:45:46 -04:00
Andrew Lamb 6a0de3a4c9
fix: add logging to read_filter rpc route (#363) 2020-10-16 09:37:49 -04:00
Andrew Lamb dc4898e1e4
feat: conversion between SeriesSets and ReadResponses (#362)
* feat: conversion between SeriesSets and ReadResponses

* fix: Address PR review comments 1

* fix: Address PR review comments 1
2020-10-16 06:37:50 -04:00
Andrew Lamb 0ef76db208
feat: implement series_query for write buffer database, tests for same (#360)
* feat: implement series_query for write buffer database, tests for same

* fix: fixup comments

* fix: sort field columns too
2020-10-15 17:23:14 -04:00
Andrew Lamb 206df6a325
feat: implement data fusion execution and conversion to series sets (#353) 2020-10-13 16:53:00 -04:00
Andrew Lamb 80088ffe37
feat: gRPC plumbing + interface structures for read_filter (#351)
* feat: gRPC plumbing + support structures for read_filter

* fix: cleanup comments
2020-10-12 14:12:53 -04:00
Andrew Lamb 3d670fb556
feat: Implement gRPC routes tag_values and measurement_tag_values (#337) 2020-10-06 17:07:03 -04:00
Andrew Lamb 45c4f1e24e
refactor: make table_names API consistent with tag_keys API, other cleanups (#327) 2020-10-02 09:42:06 -04:00
Andrew Lamb 0a48c04a9b
refactor: improve predicate conversion code (#325) 2020-10-01 17:26:39 -04:00
Andrew Lamb 2b98da593b
feat: write_database support for predicates (#326)
* feat: write_database support for predicates

* fix: temporarily pull in arrow fork to pick up fix for ARROW-10136

* fix: Update mutex usage based on PR feedback

* fix: more mutex polish and use OptionExt

* fix: update comments

* fix: rust-fu the table lookup

* fix: update docs

* fix: more idomatic rust types

* fix: better usage of reference types
2020-10-01 14:34:53 -04:00
Andrew Lamb 0976498dd9
feat: gRPC Predicate --> DataFusion Predicate conversion (#323) 2020-09-30 08:19:30 -04:00
Andrew Lamb d606a1f1cd
refactor: split delorean_write_buffer/src/database.rs into multiple modules (#317) 2020-09-28 06:20:59 -04:00
Andrew Lamb 0236522dfa
feat: Send panic information to tracing events (#313)
* feat: Send panic information to tracing events

* fix: PR Review improvements

* fix: PR comments

* fix: Apply suggestions from code review

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

* fix: more fixes

* fix: clarify /cleanup drop more

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
2020-09-25 14:55:58 -04:00
Andrew Lamb cbbcbd9196
refactor: remove lib.rs (#315) 2020-09-25 10:21:11 -04:00
Andrew Lamb 77f58efca7
chore: update Arrow/Parquet/DataFusion versions, consolidate references into new crate (#309)
* chore: consolidate all arrow/parquet/datafusion dependencies

* chore: update datafusion version
2020-09-24 08:46:54 -04:00
Andrew Lamb 498478c066
refactor: rename delorean_storage_interface to delorean_storage (#308) 2020-09-22 17:18:53 -04:00
Andrew Lamb d0f2902c8d
feat: implement tag_keys and measurement_tag_keys (#307)
* feat: implement tag_keys and measurement_tag_keys

* fix: fix timestamp bound evaluation
2020-09-22 16:42:45 -04:00
alamb 2418ee5ab0 refactor: move partitioned_store into its own module 2020-09-18 08:12:19 -04:00
Andrew Lamb 642b1b4370
refactor: move write_buffer to delorean_write_buffer crate (#299) 2020-09-18 08:11:48 -04:00
Andrew Lamb d2c24ef7af
refactor: pull storage interface into delorean_storage_interface (#298) 2020-09-18 07:58:19 -04:00
Andrew Lamb 5fe3bfd53c
refactor: extract WalDetails into delorean_wal_writer crate (#297) 2020-09-18 07:47:37 -04:00
Andrew Lamb 9cb63f47ff
feat: Implement timestamp range in measurement_names gRPC call + tests (#296) 2020-09-18 06:40:03 -04:00
Andrew Lamb d0350b9aac
refactor: move test specific database code to its own module (#295) 2020-09-17 12:31:29 -04:00
Andrew Lamb 881c2961f6
feat: [WriteBuffer][gRPC] support for measurement_names (#293)
* refactor: move GrpcInputs to its own module so I can reuse it

* feat: Basic gRPC support for listing measurements, tests for same

* fix: move Fixture definition, rename client

* fix: remove confusing doc comment
2020-09-16 17:45:28 -04:00
Andrew Lamb 565e2909ea
docs: Add some additional context to write_buffer_routes.rs (#292) 2020-09-16 07:56:10 -04:00
Andrew Lamb 358a548a0a
feat: implement skeleton Storage gRPC interface (#290) 2020-09-15 15:30:57 -04:00
Andrew Lamb 2d55076c48
feat: Basic gRPC server tests (#289)
* refactor: move TestDatabaseStore to test_fixtures

* feat: Basic gRPC server tests
2020-09-15 15:11:02 -04:00
Andrew Lamb 11e16c78d9
feat: initial WriteBuffer gRPC implementation (#287)
* feat: initial WriteBuffer gRPC implementation

* fix: remove spurious comments found in code review
2020-09-14 15:35:41 -04:00
Andrew Lamb f9fe6cdd31
test: add test for gzip content-encoding (#286) 2020-09-14 15:23:51 -04:00
Andrew Lamb 90eba702ca
refactor: Remove org/bucket from WriteBufferDatabase interface (#285) 2020-09-13 06:09:19 -04:00
alamb c4a738dfbe Revert "refactor: Remove org/bucket from WriteBufferDatabase interface"
This reverts commit f7ad7afc4f.
2020-09-12 07:06:33 -04:00
alamb f7ad7afc4f refactor: Remove org/bucket from WriteBufferDatabase interface 2020-09-12 07:05:54 -04:00
Andrew Lamb 82d5f485c3
test: traits for database and tests for http handler (#284)
* test: traits for database and tests for http handler

* refactor: Use generics and trait bounds instead of trait objects

* refactor: Replace trait objects with an associated type

* refactor: Extract an associated Error type on the Database traits

* refactor: Remove some explicit conversions to_string that Snafu takes care of

* docs: add comments

* refactor: move traits into storage module

Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@integer32.com>
2020-09-11 17:42:00 -04:00
alamb e55899f73b feat: support gzip content-encoding for api/v2/write endpoing 2020-09-10 11:49:50 -04:00
alamb 3275fc8846 docs: add comments, adjust logging levels, proper error reporting for line protcol parse errors 2020-09-10 11:10:09 -04:00
Paul Dix 8ed3a1b440
feat: Initial prototype of WriteBuffer and WAL (#271)
This is the initial prototype of the WriteBuffer and WAL. This does the following:

* accepts a slice of ParsedLine into the DB
* writes those into an in memory structure with tags represented as u32 dictionaries and all field types supported
* persists those writes into the WAL as Flatbuffer blobs (one WAL entry per slice of lines written, or WriteBatch)
* has a method to return a table from the buffer as an Arrow RecordBatch
* recovers the WAL after the database is closed and opened back up again
* has a single test that covers the end-to-end from the DB side
* It doesn't include partitioning yet. Although the write_lines method does actually try to do partitions on time. That'll get changed to be something more general defined by a per database configuration.
* hooked up to the v2 HTTP write API
* hooked up to a read API which will execute a SQL query against the data in the buffer

This includes a refactor of the WAL:

Refactors the WAL to remove async and threading so that it can be moved higher up. This simplifies the API while keeping just about the same amount of code in ParitionStore to handle the asynchronous writes.

This also modifies the WAL to remove the SideFile implementation, which was causing significant performance problems and write amplification. The downside is that WAL writes are no longer guarranteed atomic.

Further, this modifies the WAL to keep the active segement file handle open. Appends now don't have to list the directory contents and look for the latest file and open the file handle to do appends, which should also improve performance and reduce iops.
2020-09-08 14:12:16 -04:00
Carol (Nichols || Goulding) 5f49543fdf feat: Support storage of points with String and Boolean fields 2020-08-14 10:57:20 -04:00
Carol (Nichols || Goulding) d59702ec79 feat: Make the create bucket HTTP API match the Influx 2.0 API
The `/api/v2/create_bucket` API was delorean-specific for testing
purposes. This change makes it match the [Influx 2.0 API][influx] and
adds a method to the client for creating buckets.

The client will always send an empty array of `retentionRules` because
that is a required parameter for the Influx API. Delorean always ignores
`retentionRules`. The `description` and `rp` parameters are optional and
are never sent.

[influx]: https://v2.docs.influxdata.com/v2.0/api/#operation/PostBuckets

I believe the gRPC create bucket is also delorean-specific and perhaps
not needed, but I'm leaving it in for now with a note.
2020-08-12 10:08:32 -04:00
Carol (Nichols || Goulding) 34c0977820 test: Add line parser tests inspired by line protocol generation 2020-07-22 17:03:29 -04:00
Carol (Nichols || Goulding) 9302af7c56 refactor: Improve InputPath to InputReader conversion
By extracting the conversion code into a method named input_reader.
2020-07-20 20:32:09 -04:00
Andrew Lamb 143c350ecb
Merge pull request #250 from influxdata/alamb/feat-multi-col-stats
feat: Update stats command to handle directories of files
2020-07-20 16:48:31 -04:00
alamb b8dce655b3 fix: Fix use of predicate 2020-07-20 16:29:44 -04:00
Andrew Lamb 48c37e193e
fix: Apply suggestions from code review
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-07-20 16:22:46 -04:00
Carol (Nichols || Goulding) b3f6d4ab69 refactor: Make conversion from paths to InputReaders clearer 2020-07-20 10:49:05 -04:00
alamb ca1bd79902 feat: Update stats command to handle directories of files 2020-07-17 16:47:11 -04:00
Carol (Nichols || Goulding) 9a743e7c36
fix: Switch logging level from debug to info
Co-authored-by: Andrew Lamb <alamb@influxdata.com>
2020-07-16 20:32:55 -04:00
Carol (Nichols || Goulding) b1ce3958e5 fix: Define a fully-featured error for the Id type 2020-07-16 20:30:54 -04:00
Carol (Nichols || Goulding) 5afc3a1e3b fix: Ignore anything in the WAL dir that doesn't parse as an Org ID instead of crashing 2020-07-16 11:28:57 -04:00
Edd Robinson 627805c567 Merge branch 'er/feat/merge-blocks' of github.com:influxdata/delorean into er/feat/merge-blocks 2020-07-13 10:41:03 +01:00
Edd Robinson b62810676d feat: add support for merging blocks 2020-07-13 10:39:36 +01:00
Edd Robinson ad099fc722
refactor: PR feedback
Co-authored-by: Andrew Lamb <alamb@influxdata.com>
2020-07-13 10:38:47 +01:00
Edd Robinson e47277b967 feat: add support for merging blocks 2020-07-10 14:02:38 +01:00
alamb 6d78647602 Merge remote-tracking branch 'origin/master' into alamb/fix-partition-errors 2020-07-10 08:49:09 -04:00
Andrew Lamb 6ee72e5733
Merge pull request #239 from influxdata/alamb/less-chatty
fix: Make default output of delorean less chatty
2020-07-10 06:59:54 -04:00
alamb d1e334f3fe fix: Make default output of delorean less chatty 2020-07-08 18:02:48 -04:00
Edd Robinson bd5d39f60c refactor: address PR feedback 2020-07-08 22:57:15 +01:00
Edd Robinson d19094d023 refactor: PR feedback
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-07-08 22:57:15 +01:00
Edd Robinson 4e455ff595 refactor: PR feedback
Co-authored-by: Andrew Lamb <alamb@influxdata.com>
2020-07-08 22:57:15 +01:00
Edd Robinson a3a8b8273b refactor: PR feedback
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-07-08 22:57:15 +01:00
Edd Robinson a8f77c49e2 refactor: PR feedback
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-07-08 22:57:15 +01:00
Edd Robinson c5d6509ad5 feat: extend multi file conversion to CLI 2020-07-08 22:57:15 +01:00
alamb bb2518b7e9 fix: Remove StorageError 2020-07-08 17:32:16 -04:00
alamb febfbe4d45 fix: update error handling in memdb.rs and partitioned_store.rs to use standard errors 2020-07-08 17:32:16 -04:00
alamb 49555aad05 Merge remote-tracking branch 'origin/master' into alamb/fix-block-errors 2020-07-08 17:26:03 -04:00
Andrew Lamb 4a9fc5b785
fix: Apply suggestions from code review
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-07-08 17:25:44 -04:00
alamb e24e520176 fix: update error handling in block.rs 2020-07-08 11:37:06 -04:00
alamb 003a08331b fix: remove special case error message 2020-07-08 11:16:19 -04:00
alamb c840317428 fix: update error handling in database.rs 2020-07-08 11:11:02 -04:00
alamb 0ad6cb61b1 refactor: make delorean main async 2020-07-06 16:32:37 -04:00
alamb 94a39d8700 fix: use fail in error handling 2020-07-04 07:00:28 -04:00
Jake Goulding cab7cbb001 fix: Correct typo 2020-07-03 15:21:57 -04:00
alamb 4de9783409 fix: fix logical merge conflict 2020-07-03 08:15:31 -04:00
alamb 0c69fb0311 fix: clippy 2020-07-03 07:58:16 -04:00
alamb 8bd0a7b332 Merge remote-tracking branch 'origin/master' into alamb/server-errors-204 2020-07-03 07:03:34 -04:00
alamb 43b7614491 fix: simplification 2020-07-03 06:59:32 -04:00
alamb d3fe1c2751 fix: return bucket_name rather than id, and improve legibility 2020-07-03 06:50:17 -04:00
alamb 7297b41ee3 fix: return bucket_name rather than id, and improve legibility 2020-07-03 06:40:21 -04:00
alamb 598b246335 fix: implement chunk of PR review comments 2020-07-03 06:33:07 -04:00
Andrew Lamb 6884f70a87
Merge pull request #212 from influxdata/alamb/storage-errors1
fix: Improve storage predicate error handling
2020-07-02 17:31:52 -04:00
alamb 5fad7db0ac feat: Add better error handling and logging for http_routes 2020-07-01 16:08:49 -04:00
alamb f92673a393 refactor: Break up server into modules 2020-07-01 12:46:44 -04:00
Andrew Lamb b5a91fae36
Merge pull request #207 from influxdata/alamb/faster-test-harness
fix: speed up end-to-end test harness so it polls rather than waits; Add PING route
2020-07-01 12:46:05 -04:00
Andrew Lamb 54ebf380de
Merge pull request #208 from influxdata/alamb/more-logging
feat: improve error messages and logging
2020-07-01 08:49:50 -04:00
Andrew Lamb d61d4ae79a
fix: Apply suggestions from code review
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-07-01 08:46:52 -04:00
alamb 7c045b6be4 fix: Improve storage predicate error handling 2020-07-01 08:27:25 -04:00
alamb a509766e04 fix: remove whitespace for import 2020-06-30 16:23:53 -04:00
Andrew Lamb eb8aba75ec
fix: Update src/id.rs from PR review
Co-authored-by: Edd Robinson <me@edd.io>
2020-06-30 16:23:35 -04:00
alamb 9c11ae9869 feat: improve error messages and logging 2020-06-30 12:46:54 -04:00
alamb 8be278aadd fix: speed up end-to-end test harness so it polls rather than waits 2020-06-30 12:21:25 -04:00
alamb dc8d655486 feat: Implement CapabilitiesResponse 2020-06-30 11:17:45 -04:00
Andrew Lamb 97a5eb7e19
Merge pull request #197 from influxdata/alamb/log-requests
feat: Log gRPC calls using trace crate, allow custom log levels
2020-06-30 10:47:11 -04:00
Andrew Lamb 07e61cdf06
fix: fix comments
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-06-29 16:35:07 -04:00
Carol (Nichols || Goulding) 2bf9037422 refactor: Use built-in clap functionality that uses FromStr to enum
Then we can pass around an enum value and not worry about doing the
conversion anywhere else.
2020-06-29 10:54:48 -04:00
Carol (Nichols || Goulding) c6f2508abe fix: Use clap's possible_values method
This gets us built-in help text and error messages, and does less work
before failing because of an unsupported value.

Before this change, the help text was:

```
OPTIONS:
        --compression-level <compression_level>
            Compression level: max or compatibility (default). [default: compatibility]
```

After this change, the help text is:

```
OPTIONS:
        --compression-level <compression_level>
            How much to compress the output data. 'max' compresses the most; 'compatibility' compresses in a manner more
            likely to be readable by other tools. [default: compatibility]  [possible values: max, compatibility]
```

Before this change, if you supplied an unsupported value, the error was:

```
[2020-06-29T14:47:42Z INFO  delorean::commands::convert] convert starting
[2020-06-29T14:47:42Z INFO  delorean::commands::convert] Preparing to convert 591 bytes from tests/fixtures/lineproto/temperature.lp
Conversion failed: Error creating a parquet table writer Unknown compression level 'foo'. Valid options 'max' or 'compatibility'
```

After this change, the error is:

```
error: 'foo' isn't a valid value for '--compression-level <compression_level>'
	[possible values: compatibility, max]
```
2020-06-29 10:53:01 -04:00
alamb 5fe022366b fix: Use std::str::FromStr and add -c 2020-06-29 10:25:43 -04:00
alamb e8a0233b09 feat: add configurable compression level 2020-06-29 10:25:43 -04:00
alamb 283d6691c6 feat: enable rpc debug tracing, tweaked logging levels, respect RUST_FMT env var 2020-06-29 09:59:22 -04:00
Jake Goulding 99549953d6
Merge pull request #193 from influxdata/idiomatic-snafu 2020-06-26 16:35:23 -04:00
Jake Goulding 672afa1195 refactor: Merge unknown and missing extension errors 2020-06-26 16:07:35 -04:00
Jake Goulding aca63b68b2 refactor: Use more unique errors for the commands 2020-06-26 16:01:59 -04:00
Carol (Nichols || Goulding) 7f838efd80
Merge pull request #187 from influxdata/cn-bool-enc 2020-06-26 15:45:42 -04:00
Jake Goulding bca4d00716 refactor: use SNAFU more idiomatically in command modules 2020-06-26 13:26:51 -04:00
Carol (Nichols || Goulding) 9ef07cac14 feat: Implement boolean encoding
Fixes #149.
2020-06-26 10:36:27 -04:00
Carol (Nichols || Goulding) 4df99f1a7c style: Enable the clippy warning to use `Self` when recommended
Fixes #158.
2020-06-25 07:38:58 -04:00
Carol (Nichols || Goulding) afcd1efd1e style: Unify lints everywhere
Then fix the failures, mostly by adding derives and then removing some
unneeded (cheap) clones.

Document places where we purposefully don't use the same lints.

Not unifying missing_docs.

👀 https://github.com/rust-lang/cargo/issues/5034
2020-06-25 07:28:42 -04:00
Carol (Nichols || Goulding) 423ee71f5e refactor: Remove duplicated lint rules
These get inherited from crate root files, so the lint rules in
src/main.rs apply in this file already.
2020-06-24 16:56:16 -04:00
Andrew Lamb ab22384009
Merge pull request #186 from influxdata/alamb/refactor-parquet-deps
refactor: clean up parquet library deps and remove use of InputReaderAdapter (related to parquet dependencies)
2020-06-24 09:42:44 -04:00
Carol (Nichols || Goulding) 6fb107af68
Merge pull request #178 from influxdata/cn-u64-enc 2020-06-24 08:48:57 -04:00
alamb 2c4a9dba53 fix: cleanup comment + code order 2020-06-23 17:21:20 -04:00
alamb b22423621b refactor: remove InputReaderAdapter 2020-06-23 17:15:02 -04:00
Andrew Lamb 86a425e5ef
feat: Add support for parsing bool values in line protocol parser (#156)
* feat: Implement boolean support for the line protcol parser

* fix: Apply suggestions from code review

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

* fix: fmt+clippy

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-06-22 16:58:38 -04:00
Carol (Nichols || Goulding) 294163bed0 feat: Implement unsigned encoding 2020-06-22 16:52:24 -04:00
Carol (Nichols || Goulding) 1e341a7321 fix: Encode and decode string data as bytes
String data isn't guaranteed to be UTF-8
2020-06-22 15:32:14 -04:00
Carol (Nichols || Goulding) d7dbf061cb feat: Implement String encoding/decoding
Fixes #148.
2020-06-22 15:15:34 -04:00
Edd Robinson 106bd69b5a feat: support converting from TSM->Parquet 2020-06-22 18:56:17 +01:00
Edd Robinson 621f2f91f0 refactor: hoist tsm mapper to delorean_tsm 2020-06-22 18:56:17 +01:00
Edd Robinson f046dbeea0 refactor: organise code in delorean_tsm crate 2020-06-22 18:56:17 +01:00
Edd Robinson 0ca6fdfa5f refactor: StorageError -> TSMError 2020-06-22 18:56:17 +01:00