Commit Graph

83 Commits (faab75968b7cf66e824e95506f439c1301c10365)

Author SHA1 Message Date
jlapacik faab75968b refactor(storage): remove Read method from Store interface 2019-05-03 11:02:20 -07:00
Stuart Carnie bf774b66ce
fix(storage): Ensure Tag(Keys|Values) APIs never return (nil, nil)
Formalized this post condition in the documentation and added additional
unit tests.

Added a nil guard and unit test to WriteStringIterator.
2019-05-02 09:45:38 -07:00
Stuart Carnie d858bd6f77
fix(storage): Sort keys were incorrectly sorted when concatenated
This manifested as incorrect sort ordering when serialized via RPC,
resulting in an `invalid partition key order` error.

This fix introduces a delimiter to ensure sort keys cannot collide.
2019-05-01 13:37:28 -07:00
jlapacik 5d90683b07 refactor(storage): remove no points tables and streamReader interface
These tables were previously used to perform meta queries.
Meta queries are now answered using a specific API, and as
a result, these tables can go away.
2019-05-01 10:35:10 -07:00
jlapacik 95aa194498 feat(storage): ReadGroup RPC definitions and storage reader 2019-05-01 10:35:10 -07:00
Stuart Carnie 96c2282aab
fix(query): Keys must be union of all keys from all GroupCursors 2019-04-30 15:49:36 -07:00
Jonathan A. Sternberg e181edd077
fix(storage/reads): translate measurement and field tag key names (#13707)
Translate the measurement and field tag key names to their non-storage
names and add the `_start` and `_stop` tag keys to the output since
they aren't real tags, but ones that are added by range.
2019-04-29 18:11:20 -05:00
Jonathan A. Sternberg 96a76aad1d
fix(storage/reads): reserve data for the tags column when building a table (#13691) 2019-04-29 14:28:25 -05:00
Stuart Carnie fb39ac39ce
fix(storage): Store.Read behavior changed to return unsorted series keys
Closes #13581
2019-04-26 10:38:59 -07:00
Jonathan A. Sternberg 46d2d0012b fix(storage): translate _measurement and _field to the proper strings (#13662)
The RPC call should translate `_measurement` and `_field` to their
proper shortened byte strings when requesting the tag values.

This also fixes the planner rewrites to return the root node even when
no rewrite happened as this is required by the planner.
2019-04-26 10:36:51 -07:00
Jonathan A. Sternberg 5e77bd1e28
feat(query): implement the read tag values rpc call in the query engine (#13559)
If a pattern is seen that matches the `v1.tagValues(...)` call, then it
will be replaced with a direct RPC call to read the tag values for the
selected tag key which should be better optimized than reading from the
storage engine tsm1 files.
2019-04-23 12:56:35 -05:00
Jacob Marble bc2650813d
chore(storage): Merge StringIterator cursor stats (#13558)
* chore(storage): Merge StringIterator cursor stats

* add unit test

* properly count stats after iteration
2019-04-22 15:39:21 -07:00
Jonathan A. Sternberg e5657ca62b
feat(query): implement the read tag keys rpc call in the query engine (#13513)
If a pattern is seen that matches reading the tag keys, it will be
replaced with a direct RPC call to read the tag keys which should be
better optimized than reading from the storage engine tsm1 files.
2019-04-22 14:09:44 -05:00
Jacob Marble 662cf578c9
fix(storage): Assume sorted StringIterators, and retain sorted order (#13491)
* fix(storage): Assume sorted StringIterators, and retain sorted order

* embed struct field

* improve MergedStringIterator efficiency
2019-04-19 01:22:49 -07:00
Stuart Carnie 7a3b097197
fix: Add API compatibility assertion 2019-04-18 16:19:19 -07:00
Stuart Carnie 7fc9661b7b
chore: Move StringIterator to cursors package for wider reuse 2019-04-18 16:19:17 -07:00
Jacob Marble ff82e844ae
feat(storage): Add StringIteratorWriter.WrittenN() (#13456) 2019-04-17 11:05:45 -07:00
Jacob Marble 53810fadeb
feat(storage): Implement storage schema RPC de/serializer, merge, APIs (#13409)
* Extend storage service protobuf with TagKeys and TagValues

Co-authored-by: Michael Desa <mjdesa@gmail.com>
Co-authored-by: Jacob Marble <jacobmarble@influxdata.com>

* Extend the reads.Store interface with new TagKeys and TagValues APIs

* Extend readservice.store to implement refactored reads.Store interface

* Implement a StringIterator gRPC writer / serializer

* Implement a StringIterator gRPC reader / deserializer

* Implement a StringIterator merger
2019-04-16 16:01:05 -07:00
jlapacik 0cde401678 refactor(storage): update GetSource method of Store interface 2019-04-08 15:59:37 -07:00
jlapacik 8078b915fd refactor(storage): ReadFilter storage operation 2019-04-08 15:59:37 -07:00
Jeff Wendling 5d594deb2d
Merge pull request #13094 from influxdata/jmw-protobuf-bump
chore: bump gogo/protobuf and regenerate
2019-04-04 14:35:38 -06:00
jlapacik 2909927ab0
fix(reads): HasFieldValueKey searches for "$", not "_value" (#13138)
Storage converts references to _value in filter predicates to $.
It then considers any predicate that does not reference $ to be
a tag predicate. Tag predicates are used to construct series index
cursors.

This commit fixes a bug where field comparisons were being included
in tag predicates due to the HasFieldValueKey function searching
for comparison expressions referencing _value instead of $. Because
all references to _value had already been replaced. An expression
of the form '$ < 3000' would be considered a tag expression and
therefore would be mistakenly included as a tag predicate.

Fixes #13159.
2019-04-04 11:13:09 -07:00
Jeff Wendling 5dc3e52fd9 chore: bump gogo/protobuf and regenerate
It had been bumped previously from v1.1.1 to v1.2.0 and nothing was
regenerated. This bumps it to v1.2.1 and regenerates.
2019-04-03 15:42:33 -06:00
Jacob Marble 0b626beb53
chore(storage): Don't log every read request (#12881)
* don't log every read request

* check for err
2019-03-25 13:14:45 -07:00
Stuart Carnie 8abb76cb4e
Merge pull request #12710 from influxdata/sgc/data-gen
Add data generation subcommand to influxd
2019-03-20 11:08:49 -07:00
Lorenzo Affetti 7dbecfa256
fix(storage/reads): release arrow buffers when advancing on table (#12737) 2019-03-20 15:48:59 +01:00
Stuart Carnie fe8b63c10b
chore(gen): Update the gen package to produce 2.0 series keys 2019-03-19 20:35:02 -07:00
Stuart Carnie 07aef958f8
fix(reads): Interface to identify a remote streamed cursor
A cursor can be in process (local) or remote. Remote cursors have
already applied the `hasPoints` check, to reduce network traffic.
Testing whether the cursor has points again here:

https://github.com/influxdata/influxdb/blob/master/storage/reads/reader.go#L221

will always return `false` for a remote cursor that has applied the
NoPoints optimization.

This temporary fix allows the `hasPoints` function to differentiate
a streamCursor and always return true in that case.
2019-03-11 18:40:35 -07:00
Edd Robinson f029f1645d Change location and value for internal tag keys 2019-03-07 09:56:07 +00:00
Jonathan A. Sternberg 9549cc4d97
fix(storage/reads): track memory allocations when reading from storage (#12404) 2019-03-06 15:29:45 -06:00
Stuart Carnie da24fe6c7f feedback(reads): Clear r.buf before read 2019-03-05 11:45:51 -07:00
Stuart Carnie acc94985e3 fix(reads): Add retry when fetching data from StreamReader
It is possible a StreamReader (gRPC) may return an empty response. This
change adds retry and bail-out support. When a bail-out occurs,
reads.ErrStreamNoData is returned.
2019-03-05 11:45:51 -07:00
Stuart Carnie 28976e9b92 feat: Allow StreamReader to provide cursors.CursorStats
StorageReadClient adapts a gRPC Storage_ReadClient to provide
cursors.CursorStats by reading the trailer after receiving the final
message from the stream.
2019-03-05 11:45:51 -07:00
Stuart Carnie 5f241e5e5e fix(reads): Read Statistics before calling Close 2019-03-05 11:45:51 -07:00
Jonathan A. Sternberg 70507670c3
feat(storage/reads): add scanned values and bytes metadata to the query (#12156)
This updates influxdb to use the new arbitrary metadata that can be
attached by a source and adds metadata entries for the cursor
statistics.
2019-02-25 14:44:18 -06:00
Alirie Gray 5f524eb92d Rename all occurences of Macro to Variable 2019-02-14 13:21:57 -08:00
Jeff Wendling c9bb55b889 refactor: move the tsm1/wal into the storage/wal package
Because the WAL relies on the tsm1.Value type, we move that into its own
tsm1/value package and set up some aliases forwarding them into tsm1. This
also required adding some methods and changing consumers to avoid the
unexported fields. I imagine this step will be useful one day when we make
the write path more efficient with respect to consuming points.

This commit additionally fixes some issues with generation. The iterator.tmpldata
and generation for array_cursor_* were removed accidentally when removing
iterators, making those generated files stale. Restore that and regenerate.

No change in functionality.
2019-02-04 10:32:52 -07:00
Nathaniel Cook d0603457b7 refactor(flux): make packages mirror Flux namespaces 2019-01-14 18:00:45 -07:00
Nathaniel Cook 1708a41fa7 refactor: update query functions for Flux builtins 2019-01-11 13:11:57 -07:00
Jonathan A. Sternberg a59e6b8d25 refactor: rename DoArrow to Do (#2372)
See influxdata/flux#783 for details.
2019-01-10 10:30:25 -07:00
Mark Rushakoff d73d73c0d4 chore: rename imports from platform to influxdb
I did this with a dumb editor macro, so some comments changed too.

Also rename root package from platform to influxdb.

In interest of minimizing risk, anyone importing the root package has
now aliased it to "platform" so that no changes beyond imports were
necessary in those files.

Lastly, replace the old platform module to local path /dev/null so that
nobody can accidentally reintroduce a platform dependency while
migrating platform code to influxdb.
2019-01-09 20:51:47 -08:00
Nathaniel Cook 89f4525841 build(Makefile): fix various bug with makefiles
Fixes subdir ordering.
Works around issue with stringer not working with Go modules.
Fixes issues with generated code being ignored.

Fixes #2044
2018-12-19 17:02:19 -07:00
Nathaniel Cook d6c0a393b0 Merge branch 'master' into flux-staging 2018-12-19 11:30:55 -07:00
Nathaniel Cook 61e36cbee6 chore(Makefile): add target to check generated files are accurate
A standard Makefile is used now in all subdirs that run go generate.
Make will only generate the file if its source files changed.
The checkgenerate target runs clean to ensure all targets a generated
fresh.
2018-12-18 12:54:17 -07:00
Jonathan A. Sternberg cc93531400 fix(storage): convert the storage table interface to use arrow buffers
The table interface was modified to expose the arrow buffers. The
storage table has now been converted to use this interface with the same
fixes so that it exposes arrow buffers.

The influxql package has also been updated to use the `DoArrow` method
from the `flux.Table` interface.
2018-12-18 09:47:53 -07:00
Ben Johnson 0541d568bd
fix(storage): Extend lock during stats fetch to prevent race 2018-12-13 11:13:20 -07:00
Stuart Carnie 8c296dd20a
fix(storage): Add unit tests to verify nil cursor
When matching series have no data, the NewGroupResultSet cursor should
return nil. Added tests to verify these conditions.
2018-12-12 14:27:11 -07:00
Stuart Carnie f2891c3f59
fix(storage): Fix panic when read request results in empty an group
Moves the check to determine if a series has data for the current time
range into the groupBySort function, which is consistent with the
groupNoneSort function.
2018-12-12 13:22:02 -07:00
Stuart Carnie 8f8311a3ae
chore(gen): Add ingen generator data structures to platform for reuse 2018-12-11 17:45:57 -07:00
Jacob Marble b3e5e9fc31 feat(storage): return cost stats with read response via gRPC trailer 2018-12-05 15:32:41 -08:00