Commit Graph

261 Commits (60a3922446f4c210531b5df029644f4e06d70046)

Author SHA1 Message Date
Jacob Marble 386098da36
refactor(storage): move and remove to help cleanup tsdb package (#17275)
* refactor(tsdb): move series file config to seriesfile package

* refactor(tsdb): removed unchecked const EOF

* refactor(tsdb): unexport errors

* refactor(tsdb): remove unused TagValueIterators

* refactor(tsdb): remove SeriesIDIterator usage in tsdb/seriesfile

* refactor(tsdb): remove one-use MeasurementIterators

* refactor(tsdb): remove unused type measurementSliceIterator

* refactor(tsdb): remove unused types TagKeyIterators and tagKeySliceIterator

* refactor(storage): remove unused method Engine.ApplyFnToSeriesIDSet

* refactor(tsdb): rename AllSeriesIDs() -> SeriesIDs()
2020-03-16 12:23:15 -07:00
Jacob Marble 7dbc07beda
chore: Revert "refactor(storage): move and remove to help cleanup tsdb package (#17241)" (#17272)
This reverts commit 4b8a71b97f.

Fixes incident #inc-aws-error-rate-spi-5e6c1423
2020-03-13 17:14:51 -07:00
Jacob Marble 4b8a71b97f
refactor(storage): move and remove to help cleanup tsdb package (#17241)
* refactor(tsdb): move series file config to seriesfile package

* refactor(tsdb): removed unchecked const EOF

* refactor(tsdb): unexport errors

* refactor(tsdb): remove unused TagValueIterators

* refactor(tsdb): remove SeriesIDIterator usage in tsdb/seriesfile

* refactor(tsdb): remove one-use MeasurementIterators

* refactor(tsdb): remove unused type measurementSliceIterator

* refactor(tsdb): remove unused types TagKeyIterators and tagKeySliceIterator

* refactor(storage): remove unused method Engine.ApplyFnToSeriesIDSet

* refactor(tsdb): remove read from unexported field
2020-03-13 13:04:58 -07:00
Jacob Marble 26ca766459
refactor(tsdb): move series file to its own package (#17224)
* refactor(storage): move type ByTagKey to the only package that uses it

* refactor(tsdb): use types in tsdb/cursors

* refactor(tsdb): remove unused type SeriesIDElems

* refactor(tsdb): inline only use of tsdb.ReadAllSeriesIDIterator

* refactor(tsdb): move series file to its own package

* refactor(storage): remove platform->influxdb aliases
2020-03-12 11:32:52 -07:00
Jacob Marble cdbf532f57
refactor(storage): remove dead code and rename a few things (#17217)
* refactor(storage): remove CursorIterators type

* refactor(storage): remove unused tsdb.MarshalTags()

* refactor(storage): remove unused package tsdb/internal

* refactor(storage): rename tsdb/metrics.go to tsdb/series_file_metrics.go

* refactor(storage): remove unused type tagValueSliceIterator

* refactor(storage): rename field row to seriesRow

* refactor(storage): rename tsdb/index.go to tsdb/series_iterators.go
2020-03-12 10:45:48 -07:00
Sebastian Borza eeece73675
chore(storageflux): update failing tests 2020-03-10 17:54:07 -05:00
Sebastian Borza a50e69451e
feat(storageflux): move flux components out to separate package 2020-03-10 17:54:04 -05:00
Jacob Marble 9e8da7c313
refactor(storage): cleanup in storage/reads (#17163)
* refactor(storage): remove cursorContext.limit and .count

* refactor(storage): remove one-impl interface

* refactor(storage): remove one-line multiShardArrayCursors.newAggregateCursor()

* refactor(storage): mostly rename fields and variables

* refactor(storage): multiShardArrayCursors has one shard

* refactor(storage): drop misleading 'multiShard' from names
2020-03-10 07:50:47 -07:00
Jacob Marble 8bfe05e554
refactor(storage): remove reads.ResponseWriter (#17137)
ResponseWriter is only used in IDPE, so move it to that repo.
2020-03-06 15:54:11 -08:00
Jacob Marble 39b7c2ab76
refactor(storage): export IndexSeriesCursor (#17134)
* refactor(storage): add readSource field accessors

* refactor(storage): remove unused limitSeriesCursor

* refactor(storage): export IndexSeriesCursor

This allows IDPE to use the same implementation, rather than duplicate
code. Also copied unit tests from IDPE.

* chore: go fmt
2020-03-06 14:05:03 -08:00
Jacob Marble 5efde876d7
refactor(storage): rename things so flux and influxql influence is clear (#17108)
* refactor(storage): rename things so flux and influxql influence is clear

* chore: go fmt
2020-03-05 15:23:05 -08:00
Jacob Marble 1facad82dd
refactor(storage): move unused code to repo that needs it (#17090)
* refactor(storage): move unused code to repo that needs it

Turns out that a bunch of code is only needed in IDPE. This change
removes that code, and another PR adds it to IDPE.

* refactor(storage): export KeyMerger

* refactor(storage): export NilSortHi and NilSortLo

* refactor(storage): move StringIterator & friends to IDPE

* refactor(storage): unexport a few test helper funcs
2020-03-05 14:15:51 -08:00
Jacob Marble 83818e9592
fix(storage): incremental improvments (#17011)
* fix(storage): simplify storage/seriesCursor

storage/seriesCursor releases series file and TSI references sooner.

Remove unhelpful request object, inherited from 1.x

* chore(storage): replace SeriesCursor interface with sole implementation
2020-02-28 11:12:43 -08:00
Jacob Marble 9f71cad966 fix(storage): small improvements to readservice/store
Use tracing properly, simplify a few lines.
2020-02-24 13:31:36 -08:00
Stuart Carnie f1990cc92c
feat(mock): Add SeriesGenerator to ResultSet transformation
In addition, adds a ResultSetToLineProtocol function, which
transforms a `ResultSet` into InfluxDB line protocol.
2020-02-12 14:20:31 -07:00
Jacob Marble a56e0226e6
fix(storage): check engine closed before collecting index metrics (#16656) 2020-01-23 15:27:25 -08:00
Jacob Marble b836ab9c17
feat(storage): implement backup and restore (#16504)
* feat(backup): `influx backup` creates data backup

* feat(backup): initial restore work

* feat(restore): initial restore impl

Adds a restore tool which does offline restore of data and metadata.

* fix(restore): pr cleanup

* fix(restore): fix data dir creation

* fix(restore): pr cleanup

* chore: amend CHANGELOG

* fix: restore to empty dir fails differently

* feat(backup): backup and restore credentials

Saves the credentials file to backups and restores it from backups.

Additionally adds some logging for errors when fetching backup files.

* fix(restore): add missed commit

* fix(restore): pr cleanup

* fix(restore): fix default credentials restore path

* fix(backup): actually copy the credentials file for the backup

* fix: dirs get 0777, files get 0666

* fix: small review feedback

Co-authored-by: tmgordeeva <tanya@influxdata.com>
2020-01-21 14:22:45 -08:00
Edd Robinson de36a868f7 refactor: add engine write benchmarks 2020-01-16 21:01:57 +00:00
Edd Robinson 5a179b1f95
Merge pull request #16265 from influxdata/er-dump-wal-pred
feat: add predicate output to WAL dump tool
2020-01-02 11:46:57 +00:00
Johnny Steenbergen e6f1805e5e chore(inmem): nuke the duplicative inmem store
use kv store... its a thing
2019-12-30 11:04:45 -08:00
David McKay 8db09124e6 fix: update test to use 'valid' marshalled predicate 2019-12-18 15:33:44 +00:00
Edd Robinson e24b66d78a feat: add predicate output to WAL dump tool 2019-12-18 12:05:26 +00:00
Greg 41e771a464
feat(http): expose list of available telegraf plugins (#16233) 2019-12-17 16:53:19 -07:00
Jonathan A. Sternberg fe94c5cae4
feat(storage/reads): add cache to reuse tags when reading from storage (#16041)
This adds an lru cache for the columns that are produced as tags. When
producing the columns that are part of the group key, it will generate
the column and then keep it in an lru cache to reuse for future tables.
The start and stop column are effectively cached for every table because
they are special and will be the same for all of the tables.

For the tags, it retains the most recently used since they may be used
by a future table. That way most of the columns will get shared with
each other.

When the size differs, a slice is used so the underlying data is still
shared, but the size is different.
2019-11-27 08:31:53 -06:00
Jonathan A. Sternberg 2b4e6283ce
perf(storage/reads): remove the duplicate filter (#16024)
This removes the duplicate filter that is used by the reader. The
storage engine shouldn't be sending us duplicate tables anyway and this
code hurts performance in high cardinality queries because of the memory
it uses to keep track of all of the keys that have been seen.
2019-11-22 12:38:16 -06:00
Edd Robinson 0999f88273 fix: prevent integer overflow 2019-11-22 14:06:21 +00:00
Chris Goller 0f5df301ca refactor(storage/readservice): rename View interface to Viewer 2019-11-20 16:10:37 -06:00
Chris Goller 7de2cafb13 feat(storage/readservice): define engine interface
We added an interface for the *storage.Engine to make it easier
to add end-to-end tests.

Co-authored-by: Bucky Schwarz <d.w.schwarz@gmail.com>
2019-11-20 15:54:32 -06:00
Edd Robinson 8f6701d4b1 feat(storage): add full compaction semaphore
By default this feature is disabled; the full compaction behaviour does
not change. When this feature is enabled compactions can be limited
across multiple storage engines running in multiple processes.

The mechanism by which this happens is not part of the abstraction added
here.
2019-10-23 19:45:01 +01:00
Brandon Farmer ea82dc3470 fix(tasks): tasks look up system bucket id 2019-10-21 14:48:47 -07:00
Brandon Farmer 2e0749b3ba feat(influxdb): Add system buckets on org creation
* Only allow users to create user buckets
* Only accept bucket creation parameters on post
2019-10-21 14:48:47 -07:00
Kelvin Wang 62f4042853 feat(influxdb): add predicate package 2019-10-18 12:02:52 -04:00
Edd Robinson 179c57ab2e feat(storage): allow compaction limiter to be injected 2019-10-04 12:35:21 -07:00
elbehery c0b87c657c fix(storage): remove level=0 from TSM disk bytes metrics. 2019-09-25 15:57:25 +02:00
Brandon Farmer d83fabeabc feat(influxdb): user disabling 2019-09-23 11:57:16 -07:00
Edd Robinson db72f57da4 feat(storage): inject function to control when retention enforcer runs (#15136)
* test(storage): ensure multiple engines can run concurrently

* feat(storage): expose control over retention run

Fixes #15134.

This commit adds the ability to inject a functional option into a
storage.Engine for controlling when the retention enforcer can run.

Previously, retention enforcers ran on an interval; if you ran multiple
storage engines (as we do in some environments) then it was not possible
to coordinate when engines ran retention. Often they would synchronise
because they started at the same time.

This change will let you specify a blocking function to control when the
retention enforcer can run.

A simple function for serialising retention enforcement across multiple
storage engines could look like:

```go
var mu sync.Mutex
func f() (done func()) {
    mu.Lock()
    return func() { mu.Unlock() }
}
```
2019-09-23 08:09:04 -07:00
Lorenzo Affetti 053836e5a5
Merge pull request #15203 from influxdata/flux-staging-v0.48.x
build(flux): update to Flux v0.48.0
2019-09-20 18:24:02 +02:00
Lorenzo Affetti ab835c8e0e
refactor(dependencies): use new dependency injection framework (#15174)
refactor(dependencies): use new dependency injection framework
2019-09-19 17:01:17 +02:00
Edd Robinson e2f5b2bd9d refactor(storage): add more context to traces and logs 2019-09-19 13:48:06 +01:00
Ben Johnson 9237ee6a40
fix(tsi1): Remove TSI cardinality stats cache 2019-09-04 14:48:22 -06:00
George 8109d161bb
perf(storage): expose ability to peek on stream readers (#14901) 2019-09-04 13:57:36 +00:00
Nathaniel Cook dfc28335ea refactor(query/dependencies): update to new Flux dependencies defaults 2019-08-26 16:46:17 -06:00
Adam 945b68b8fd fix(query): finish refactoring the repl and inject the secret service as a dependency 2019-08-26 16:46:17 -06:00
Nathaniel Cook 6303e2dcc5 test(query): skip holt_winters_panic test
added executor dependencies where needed
2019-08-26 16:46:17 -06:00
Adam Perlin 76dbc44e3c
feat(storage): Add influxd inspect dumpwal tool (#14237)
* feat(storage/wal/dump): initial influxd inspect dumptsmwal implementation

* feat(storage/wal/dump): add org bucket formatting to dumpwal tool; improve test cases

* refactor(storage/wal/dump): add long description for dumpstmwal tool

* refactor(storage/wal/dump): rename dumptsmwal flag

* chore(storage/wal/dump): gofmt

* refactor(storage/wal/dump): update error printing in dumptsmwal tool

* refactor(storage/wal/dump): address review comments

* refactor(storage/wal/dump): rename dumpwal command source file

* refactor(storage/wal/dump): clarify print flag comment

* refactor(inspect): remote unnecessary for-loop in influxd inspect command
2019-08-23 13:05:06 -07:00
Jacob Marble 851279b71f
chore(storage): bring back storage_retention_checks_total (#14735) 2019-08-22 10:47:27 -07:00
Edd Robinson d160585a34 refactor(storage): add deeper tracing around deletes 2019-08-22 11:08:33 +01:00
Jacob Marble 26d29f7aa5
chore(storage): remove metric storage_retention_checks_total (#14719) 2019-08-20 14:39:08 -07:00
Stuart Carnie f60c2ec3ba
fix(reads): Remove issue reference from test per feedbakc 2019-08-16 13:00:06 -07:00
Stuart Carnie 3ca751cfd6
fix(reads): ResponseWriter truncates values for last series
The ResponseWriter would truncate the last series if the byte size of
the points frames exceeded the writeSize constant, causing a Flush to
occur and the cumulative ResponseWriter.sz to reset to zero. Because
ResponseWriter.sz was not incremented for each frame, it remained at
zero, which resulted in the final Flush short circuiting.

This commit implements the Size method for the cursors.Array types
to be used to estimate the size of frame. This is in place of calling
the Protocol Buffer `Size` function, which can be very expensive.
2019-08-16 10:36:40 -07:00