Commit Graph

39 Commits (b25b4021c3b09b52db56af4ea42fca69182bcbde)

Author SHA1 Message Date
Jonathan A. Sternberg 0ae8bebd75
refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
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 5f19c6cace
chore: Remove several instances of WithLogger (#15996)
* chore: Remove several instances of WithLogger

* chore: unexport Logger fields

* chore: unexport some more Logger fields

* chore: go fmt

chore: fix test

chore: s/logger/log

chore: fix test

chore: revert http.Handler.Handler constructor initialization

* refactor: integrate review feedback, fix all test nop loggers

* refactor: capitalize all log messages

* refactor: rename two logger to log
2019-12-04 15:10:23 -08:00
Edd Robinson 7efb73930b refactor: address PR feedback 2019-08-30 21:07:32 +01:00
Edd Robinson f2d6c93e65 test: add benchmark to track cache deletion perf
Benchmarks using a 24T / 32GB / NVME disk machine:

goos: linux
goarch: amd64
pkg: github.com/influxdata/influxdb/tsdb/tsm1
BenchmarkEngine_DeletePrefixRange_Cache/exists-24         	      20	 280039668 ns/op	64073374 B/op	  711421 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/exists-24         	      30	 271810284 ns/op	64073207 B/op	  711420 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/exists-24         	      30	 263464797 ns/op	64072589 B/op	  711415 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/exists-24         		      30	 269460489 ns/op	64073344 B/op	  711420 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/exists-24         	      30	 268319443 ns/op	64073947 B/op	  711425 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/exists-24         	      30	 254945449 ns/op	64073463 B/op	  711421 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/exists-24         	      30	 270202990 ns/op	65616337 B/op	  724440 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/exists-24         	      30	 274113444 ns/op	64074764 B/op	  711435 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/exists-24         	      30	 264234897 ns/op	64073748 B/op	  711428 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/exists-24         	      30	 264406196 ns/op	64073797 B/op	  711429 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/not_exists-24     	      30	 250130623 ns/op	59202124 B/op	  700036 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/not_exists-24     	      30	 255092042 ns/op	59552365 B/op	  706287 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/not_exists-24     	      30	 274121068 ns/op	59202753 B/op	  700043 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/not_exists-24     	      30	 273088065 ns/op	59202702 B/op	  700043 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/not_exists-24     	      30	 264184087 ns/op	59202724 B/op	  700043 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/not_exists-24     	      30	 268075364 ns/op	59202718 B/op	  700043 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/not_exists-24     	      30	 265067057 ns/op	59202709 B/op	  700043 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/not_exists-24     	      30	 254749976 ns/op	60118957 B/op	  701435 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/not_exists-24     	      30	 266953837 ns/op	59203376 B/op	  700051 allocs/op
BenchmarkEngine_DeletePrefixRange_Cache/not_exists-24     	      30	 275083559 ns/op	59203329 B/op	  700050 allocs/op
PASS
ok  	github.com/influxdata/influxdb/tsdb/tsm1	261.273s
2019-08-30 20:35:05 +01:00
Edd Robinson d160585a34 refactor(storage): add deeper tracing around deletes 2019-08-22 11:08:33 +01:00
tmgordeeva 48ee7ada04
fix(storage): move retention snapshot out of per bucket calls (#14420)
* fix(storage): move retention snapshot out of per bucket calls

Also adds tracking for snapshots from retention and full compactions.
2019-07-23 11:40:05 -07:00
Jeff Wendling 4096f93891 tsm1: implement reading and writing predicates in tombstone files 2019-05-01 13:40:40 -06:00
Jeff Wendling 7403fd8aa9 tsm1: rename engine method to DeletePrefixRange
The storage/engine knows about buckets, but the tsm1/engine doesn't, so
name the tsm1/engine method Prefix and keep the storage/engine named
Bucket.
2019-05-01 13:40:40 -06:00
Ben Johnson 272f340c30
Merge point parse & explode. 2019-04-24 10:12:15 -06:00
Stuart Carnie d3790aa072
feat: Teach storage engine how to find tag values for a given key
The TagValues API will perform a linear scan if there is no predicate;
otherwise, it will use the index to find a list of candidate series
keys.

TagValues expects the predicate to be transformed such that
`_measurement` and `_field` are remapped to `\x00` and `\xff`
respectively.

There is one TODO marked to analyze the predicate for a
`\x00 = '<measurement>'` pattern. If found, the predicate can be
eliminated and fall back to a linear prefix scan by combining the org,
bucket and measurement.
2019-04-18 16:19:18 -07:00
Edd Robinson 55e9ed689f Allow the tsm1.Cache to be snapshotted due to age
This commit adds a new Cache option, via the
`tsm1.CacheConfig.SnapshotAgeDuration` field, which controls the maximum
age the cache can reach before it is snapshotted to a TSM file.

The default value for this option is `0`, which means that the cache
will never be snapshotted based only on age. Setting this value to, for
example, 10 seconds, would result in the cache snapshotting every 10
seconds.

Snapshotting the cache more frequently can provide better durability
guarantees in some circumstances, though more, smaller TSM files will
lead to more work needed to compact them down to larger, more dense
files.

When using InfluxDB with a WAL there isn't really a strong reason to
alter `tsm1.CacheConfig.SnapshotAgeDuration` from `0`.
2019-03-25 11:44:01 +00:00
Edd Robinson 4022db03c2 Provide explicit cache snapshot reasons 2019-03-25 11:44:01 +00:00
Jacob Marble b9c7ec439e
feat(influxd): Tracing refactor (#12318)
* feat(launcher): Tracing to log disabled by default

* remove traceLogger and use opentracing directly

* add Jaeger tracing

* go vet && go fmt
2019-03-04 11:48:11 -08:00
Jeff Wendling 0fae44e219 storage: fix problems with keeping resources alive
This commit adds the pkg/lifecycle.Resource to help manage opening,
closing, and leasing out references to some resource. A resource
cannot be closed until all acquired references have been released.
If the debug_ref tag is enabled, all resource acquisitions keep
track of the stack trace that created them and have a finalizer
associated with them to print on stderr if they are leaked. It also
registers a handler on SIGUSR2 to dump all of the currently live
resources.

Having resources tracked in a uniform way with a data type allows us
to do more sophisticated tracking with the debug_ref tag, as well.
For example, we could panic the process if a resource cannot be
closed within a certain time frame, or attempt to figure out the
DAG of resource ownership dynamically.

This commit also fixes many issues around resources, correctness
during error scenarios, reporting of errors, idempotency of
close, tracking of memory for some data structures, resource leaks
in tests, and out of order dependency closes in tests.
2019-02-28 10:22:01 -07:00
Jeff Wendling 3014733b20 chore: fix staticcheck issues 2019-02-04 10:32:52 -07:00
Jeff Wendling 7f54e816e3 refactor: have retention use DeleteBucketRange 2019-02-04 10:32:52 -07:00
Jeff Wendling d2ddd48eea refactor: hook up metrics and wal to storage engine
It turns out that LastModified and DiskSize are unused, and so it
was easy to change to not care about the WAL.

This hooks up metrics and starts the WAL again.
2019-02-04 10:32:52 -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
zhulongcheng 085ce852b7 remove CreateSeriesIfNotExists from engine tests 2018-11-21 20:16:45 +08:00
Mark Rushakoff 8ab01c99c0 test(tsdb/tsm1): skip long tests in short mode
The tsdb/tsm1 package was one of the test suites that took the longest
to run in platform with go test -short. The rule of thumb on the Go
project is that short mode should skip any individual test that takes
longer than one second. This change skips two such tests, and it
eliminates a string concatenation loop in two other tests, so that they
report completion in "0.00s" rather than about 0.94s, on my machine.

These cumulative changes take `go test -short ./tsdb/tsm1` from about 14
seconds to about 7 seconds on my machine.
2018-11-16 08:06:23 -08:00
Jeff Wendling 4b504b84df respond to review feedback
- Add some documentation.
- Move compaction planner to an option instead of config.

The latter fits with the general theme of having config be things
that can be specified in a toml, and everything else being an
option.
2018-11-08 11:39:36 -07:00
Jeff Wendling 22e23d6e31 final touches
- move default directories to the storage package
- make the directory layout match before
- clean up some dead missed functions
2018-11-08 11:39:36 -07:00
Jeff Wendling 0d411023f2 config: clean up
- Breaks the weird cycle that existed with the EngineOptions
- Removes a bunch of useless parameters
- Moves around a bunch of defaults
2018-11-08 11:39:36 -07:00
zhulongcheng 594664a876 remove RegisteredIndexes tests 2018-11-05 00:00:02 +08:00
Jeff Wendling 381d449b82 tsm1: remove digests and backup/restore 2018-10-31 15:41:07 -06:00
zhulongcheng 9d29874e20 move SeriesFileDirectory constant to defaults package 2018-10-27 02:08:31 +08:00
zhulongcheng c89c79dc02 replace tsdb.Index interface with tsi1.Index instance
This fix is to remove tsdb.Index interface to resolve #886.
2018-10-27 02:08:31 +08:00
zhulongcheng 427d719af8 remove tsdb.IndexSet tests
This fix is to remove tsdb.IndexSet to resolve #886.
2018-10-27 02:08:31 +08:00
Jeff Wendling ce3e1fa90d Remove the fields index
This commit removes the remaining bits of the fields index. In doing
so, the buildCursor method on the engine would need to be updated.
It turns out, that code was statically dead, so delete it and anything
that depended on it. Additionally, delete anything as reported by
the unused tool in the tsdb package.
2018-10-15 10:22:07 -06:00
Jonathan A. Sternberg e7e17d6972
refactor: move the logger package from influxdb to platform
We are moving the necessary code for 2.0 from the influxdb 1.X
repository to the platform 2.0 repository. The logger is an unnecessary
dependency on the old influxdb that is making life more complicated.
2018-10-10 15:49:07 -05:00
Jeff Wendling 555c454cd8 Remove the radix tree series type conflict stuff 2018-10-09 09:05:20 -06:00
Jeff Wendling 0360fc418c Remove empty index package for tsi1 2018-10-08 13:18:30 -06:00
Edd Robinson 981b2cdbea Skeleton storage engine 2018-10-04 10:24:43 +01:00
Edd Robinson ea02772fc5 Pull in more pkg packages 2018-10-01 12:08:37 +01:00
Edd Robinson 074f263e08 Initial import of tsm1.Engine 2018-10-01 12:08:37 +01:00