Commit Graph

8975 Commits (c62c7d32b1fad95dc3b4d11fe8c9a7dcd3dae891)

Author SHA1 Message Date
Jake Goulding 81468f9e5e ci: Adjust builds to run on highly parallel CI machines
By default, the RocksDB C library is compiled using the number of
cores on the machine. In CircleCI, this is 36 cores. Unfortunately,
that appears to completely blow out the memory usage, causing the C
compiler invocations to be killed.

This commit reduces the *entire* parallelism of the build to avoid
that.
2020-02-09 22:22:10 -05:00
Edd Robinson 7a9f69c921 refactor: address PR feedback 2020-02-07 22:28:11 +00:00
AJ d268087b24
Merge pull request #23 from influxdata/chore/add-circleci
chore(circleci): setup circleci
2020-02-07 17:23:36 -05:00
AJ Bond 7a65f5550f
chore(circleci): add tiered cache configuration 2020-02-07 12:25:32 -05:00
AJ Bond c2de967e36
chore(circleci): setup circleci
This configures a circleci pipeline that runs fmt, lint, test, and build operations.
I changed the fmt command to --check since --overwrite is no longer supported.
The pipeline will always run on nightly builds of rust.
2020-02-07 11:46:47 -05:00
Edd Robinson 5327efd926 test: add timestamp benchmarks 2020-02-07 13:26:59 +00:00
Edd Robinson bd8246d561 test: add integer encoder/decoder benchmarks 2020-02-07 13:11:38 +00:00
Edd Robinson 4185307d78 test: add float encoder/decoder bencmarks
This commit adds benchmarks for the float encoder and decoder. The
following scenarios are benchmarked:

- sequential values;
- random values;
- real CPU values (from Telegraf output).

Each scenario is benchmarked with a variety of block sizes.
2020-01-21 15:01:35 +00:00
Paul Dix 418b89a87b
Merge pull request #20 from influxdata/pd-add-stubs-for-other-datastores
feat: add memory backed inverted index and series store
2020-01-13 10:35:41 -05:00
Paul Dix f1329a8a08 Remove unused code 2020-01-13 10:34:41 -05:00
Paul Dix bec6b3cf9c Add MemDB and test framework
This commit adds a test framework for the InvertedIndex and SeriesStore traits. Structs that implement these traits can call into their tests to ensure they work.

This commit also adds an in memory database that keeps time series data in a ring buffer per series and an inverted index in memory using a combination of HashMap and BTreeMap.
2020-01-13 10:31:47 -05:00
Paul Dix 80493ba517 Refactor database for arbitrary backends
This commit pulls the database behavior into three traits: ConfigStore, InvertedIndex, and SeriesStore. The ConfigStore holds the Bucket definitions, the InvertedIndex holds the index of measurement names, tags, and fields, and the SeriesStore holds the raw time series data indexed only by bucket id, series id, and time.

This is the initital work to enable memory and S3 backed databases. It is also the preliminary work to break data out into shards.
2020-01-13 10:31:47 -05:00
Edd Robinson 62a0f26066 refactor: src doesn't need to be mutable 2020-01-13 14:59:51 +00:00
Edd Robinson 79592e7e11
Merge pull request #19 from influxdata/er-float-encoder
feat: add float encoder and decoder
2020-01-13 09:57:29 +00:00
Edd Robinson c1492994e0 refactor: tidy up 2020-01-12 15:37:30 +00:00
Edd Robinson 2a1ddf5669 feat: add float encoder 2020-01-12 15:37:26 +00:00
Edd Robinson 5940cdd8a9
Merge pull request #18 from influxdata/er-cargo
fix: cargo lock file
2020-01-07 16:32:52 +00:00
Edd Robinson 75d378974e fix: cargo lock file 2020-01-07 16:05:46 +00:00
Edd Robinson 5449c29f24
Merge pull request #17 from influxdata/er-env
feat: automatically create db and test directories
2020-01-07 13:52:45 +00:00
Edd Robinson 1757a7627f refactor: add example env file 2020-01-07 11:31:18 +00:00
Edd Robinson 80ff911259 feat: automatically create db dir and test dir 2020-01-06 15:55:22 +00:00
Edd Robinson 8bf91ef10e refactor: remove env file 2020-01-06 15:53:06 +00:00
Edd Robinson 8b412af05a
Merge pull request #16 from influxdata/er-rustfmt
refactor: rustfmt
2020-01-06 15:51:32 +00:00
Edd Robinson b06d1005a8 refactor: rustfmt 2020-01-06 13:49:39 +00:00
Paul Dix 2c9fccb810
Merge pull request #12 from influxdata/pd-update-write-api
Wire up write and read to the API
2020-01-06 08:32:50 -05:00
Paul Dix ca9667909f
Merge pull request #14 from influxdata/pd-fix-warnings
Fix compile warnings from the Rust linter
2020-01-06 08:31:40 -05:00
Paul Dix a1a552b1b6
Merge pull request #15 from influxdata/pd-add-float-support
Add support for float64
2020-01-06 08:30:11 -05:00
Paul Dix af9e1cae32 Fix race condition on new series in RocksDB
There was a race condition when inserting new series into RocksDB that would cause series being inserted by two separate threads to cause an error. The thread that inserts is fine, but the one after would see that it inserted, but not read in the ID so it can later be used to write the points.
2020-01-05 19:34:05 -05:00
Paul Dix 04bd6b8a12 Update line protocol parser
The earlier version of this line protocol parser incorrectly used a space as a delimiter between fields. This updates it to use a comma as it is in InfluxDB 1.x and 2.x.
2020-01-05 19:32:35 -05:00
Paul Dix ce69c5a9ce Update read API to return float series
Updates to read API in main.rs to return values for float series. I'm not terribly happy with the way I had to do this, but I was struggling a bit with the type system gymnastics. I assume I'll have to revisit this anyway when I add support for other storage backends.
2020-01-05 19:31:42 -05:00
Paul Dix b784563792 Add support for float64 to rocksdb
Adds support for for f64 time series in RocksDB. Series data types are now stored in the index under the id to key mapping, which is now id to type and key.

This doesn't enforce the same data type for values being written into a series, which will come later. Also later will be adding support for float64 series in the read API.
2020-01-05 18:38:45 -05:00
Paul Dix 8754911b5a Add support for float64 to line protocol parser
Adds support for f64 to the line protocol parser. Also updates the return value of parse to return a Vec of mixed type points that can be later written into the database.

The PointType struct is only for use in this context. In the context of querying or working with time series for compaction, we'll want vectors of actual typed points of the same kind so we don't have to do inefficient enum matches.
2020-01-05 16:28:12 -05:00
Paul Dix c7a862dca0 Fix compile warnings from the Rust linter
This commit fixes all the linter warnings. However, there are a number of spots, particularly in the encoders where I added `#[allow(dead_code)]` to get past them. We should go through and fix those up at some point, I'll log an issue to track.
2020-01-05 13:44:03 -05:00
Paul Dix 1a851f8d0b Add basic read endpoint
This commit adds a basic read endpoint to pull data out of the database. In order to provide the basic functionality a few things were added:

* Time package with limited support for parsing Flux style durations
* API endpoint at /api/v2/read with query paramters of org_id, bucket_name, predicate, start, and stop

The start and stop query parameters only support relative durations.

The predicate parameter supports what is possible in the parse_predicate method and in the RocksDB implementation (only == comparisons on tags and AND or OR)
2020-01-04 19:07:54 -05:00
Paul Dix fe9cb87c3d Update rocks db series filter
Add the series key to the SeriesFilter struct that is returned when searching the index.
2020-01-03 17:35:18 -05:00
Paul Dix 4265e7b11b Update write API endpoint
Upates the actix-web and actix-rt versions to 2.0 and 1.0 respectively. Wires up the write endpoint to create buckets if they don't exist.
2020-01-03 17:35:18 -05:00
Paul Dix 4892a87898 Implement read range on the database
This commit adds iterators for iterating over series and batches of points for a read range request. The exact signature/structure of the iterators are likely to change when this is generalized for other data types and other storage backends (S3 & memory).
2020-01-03 17:35:18 -05:00
Paul Dix c76ce39da5 Update rocksdb.rs write_points
This commit updates the write_points method to use the bucket id and series id in the key for a stored point value.

It also updates the Database methods to be immutable borrows moving any mutable concerns into interior structures so it can be easily called from many threads.
2020-01-03 17:35:18 -05:00
Paul Dix 4f02be1828
Merge pull request #10 from influxdata/pd-create-local-index
feat(storage): Add local RocksDB based index
2020-01-03 12:09:29 -06:00
Paul Dix 3c8f93a9a7 Implement OR in predicate
Adds support for logical OR operator in predicates against the index.
2019-12-24 15:25:43 -05:00
Paul Dix f3807456c9 Implement AND in predicate
Adds support for logical AND operator in predicates against the index.
2019-12-24 15:21:04 -05:00
Paul Dix 6cd4c5b583 Add basic tag key/value index
This commit brings in a Roaring Bitmap implementation to keep postings lists of tag key/value pairs to the set of series ids that have those pairs. The croaring implementation was used becasue the Treemap was required for u64 support for series ids and it was serializable (unlike the other pure Rust roaring implementation).

This doesn't shard the postings lists based on size. It also doesn't implement the time/index levels.

The predicate matching currently only works for a simple key = "value" match.
2019-12-24 13:44:30 -05:00
Paul Dix f77b0a3842 Move storage module into directory
Moved the storage module into its own directory. Split into the rocksdb portion of the code and the predicate parsing.
2019-12-23 11:49:58 -05:00
Paul Dix 71fe0aa71c Update storage with predicate parsing
Adds a basic predicate parser to make testing the index easier
2019-12-23 11:36:12 -05:00
Paul Dix 54ef130cea Wire up get tag values in storage
This adds basic support for getting tag values in storage. Still needs to add predicate and time range support.
2019-12-20 13:46:41 -05:00
Paul Dix 7effec0f48 Add shell of index functions and get tag keys
Added the shell of index functions to return series IDs that match a predicate, tag keys with a predicate, and tag values with a predicate.
2019-12-20 13:07:03 -05:00
Paul Dix 7f2f4eaceb Update mod.rs
Add parser for key/value pairs to be indexed. Measurement and field are represented as _m and _f respectively.
2019-12-20 13:05:59 -05:00
Paul Dix 5d80d5e100 feat(storage): Add series to ID index
This commit is the beginning of the RocksDB based index for series and their tag metadata.

I started to stub out different index levels but stopped short of implementing them.

There are a number of spots where I'm unwrapping return values that we may want to revisit later. For now I want to have the program panic if those things pop up.
2019-12-19 15:58:00 -05:00
Paul Dix 1a10243b46 Update integer.rs
Fix build error in test
2019-12-19 15:50:22 -05:00
Paul Dix 9deb3ea1ca
Merge pull request #8 from influxdata/pd-create-bucket-storage
feat(storage): Implement bucket definitions and persistence
2019-12-19 11:05:39 -05:00