Commit Graph

2409 Commits (adbfee28b321990d024fe1242b957aee3346666d)

Author SHA1 Message Date
Jacob Marble ffe54d0239 Revert "Resolve deadlock"
This reverts commit 681f22b078.
2018-07-09 22:05:54 -07:00
Edd Robinson ad388a8fd8 Address PR feedback 2018-07-09 11:51:48 +01:00
Edd Robinson 11bea138f8 Restrict buffer size 2018-07-09 11:51:48 +01:00
Edd Robinson 96ed566e6c Store series ID sets in LogFile as bitmaps
This commit swaps out map[uint64]struct{} implementations for roaring
bitmaps, which in turn improves memory usage and read performance.

The bitmap implementation is abstracted such that for low cardinality
sets a simple slice of ids is used, to reduce in-use memory.
2018-07-09 11:51:48 +01:00
Edd Robinson 13f896b9ff Buffer writing of .tsl file with 128K buffer 2018-07-09 11:51:48 +01:00
Edd Robinson 3cf20823e9 Allow LogFile buffer size to be changed
When adding many series using offline tooling, it's likely that every
series involves an entry being appended to a LogFile. Typically an entry
is 11 or 12 bytes, but the default bufio.Writer buffer size is only 4K.

This means by default a write of 10,000 new series would involve ~30
buffer flushes.

This commit makes the buffer configurable, and sets the value in
`buildtsi` such that it reflects the number of series being written to
the LogFile.
2018-07-09 11:51:48 +01:00
Edd Robinson 681af04815 Optionally disable buffer flushing/file syncing
When running offline tooling, flushing buffers and syncing files on
every write to a `LogFile` is not necessary. Were a hard exit
with data loss to occur, the tooling can simply be run again.
2018-07-09 11:51:15 +01:00
Jacob Marble b7d5e2ecdf
Merge pull request #10050 from influxdata/jgm-delete-regex
Resolve deadlock deleting from many measurements concurrently
2018-07-08 17:01:33 -07:00
Jacob Marble 681f22b078 Resolve deadlock
TSI LogFile compactions occasionally race with insert and delete
operations because the index partition FileSet is retained needlessly by
the method that calls Partition.CheckLogFile.

In this change:
- TSI LogFile compaction respects enable/disable compactions
- Partition FileSet.Release before log compaction is triggered

An alternative to the second step is to handle log file compaction in a
new goroutine. Log file compaction errors would be logged and not
returned to the caller.

After this change, `DELETE FROM /regex/` does not deadlock; performance:
- 30s to delete 100 measurements
- 5m30s to delete 1000 measurements
2018-07-06 15:02:38 -07:00
Jacob Marble 2ac811e57e close objects without swallowing errors 2018-07-06 13:45:22 -07:00
Jacob Marble 0af22b5992 Partition receiver rename
Got tired of referring to Index Partitions as `i` instead of `p`.
2018-07-05 14:28:00 -07:00
Jacob Marble dcb85d2e92 Init TSI partition logger
TSI Partition logging was never initialized because WithLogger was
called after Open; Open initializes Partition loggers.
2018-07-05 14:27:09 -07:00
Ben Johnson 979d790154
Implement bitset iterator 2018-07-05 09:01:22 -06:00
Edd Robinson 6059db3d3a Filter series IDs at the last possible moment 2018-07-02 16:48:40 +01:00
Edd Robinson 609b980671 Don't filter at low-level 2018-07-02 16:47:44 +01:00
Edd Robinson 0060b83644 create iterator benchmark 2018-07-02 16:47:44 +01:00
Ben Johnson 7727a4a67f
Merge pull request #9977 from influxdata/bj-show-tag-values-value-filtering
Allow value filtering on SHOW TAG VALUES
2018-06-28 10:25:19 -06:00
Ben Johnson 8be85c154a
Allow value filtering on SHOW TAG VALUES
This commit allows users to filter on the `value` field in the
`SHOW TAG VALUES` command:

	SHOW TAG VALUES WITH KEY = "mytag" WHERE "value" = 'myvalue'

Previously this command would return all values.
2018-06-28 09:50:03 -06:00
Ben Johnson edcb391022
Improve series segment recovery. 2018-06-26 10:56:44 -06:00
Jeff Wendling 1c0e49e002 tsm1: ensure all written tsm files are fsynced
we were asserting to an *os.File in order to call Sync, but in some
cases the file handle has been wrapped, for example with limiting.
instead, assert to minimal interfaces for the functionality we need
and attempt to add some robustness in the code that creates the
writers by using a stronger interface with a Sync method.

fixes #9991
2018-06-25 11:36:22 -06:00
David Norton d61c4a43b0
Merge pull request #9986 from influxdata/dn-add-digest-logging
add digest logging
2018-06-21 11:56:21 -04:00
Ben Johnson ccadb3799c
Merge pull request #9982 from influxdata/bj-tsi-wal-flush-sync
Flush/sync TSI1 WAL
2018-06-20 15:34:15 -06:00
Ben Johnson fd5a2116d7
Flush/sync TSI1 WAL 2018-06-19 08:32:33 -06:00
Tanya Gordeeva cff3a1120e Fix flaky test TestStore_BackupRestoreShard
Iterator could be left open.

Fixes #9965
2018-06-18 09:45:26 -07:00
David Norton aa61f5016e
Merge pull request #9970 from influxdata/dn-show-tag-keys-perf
fix SHOW TAG KEYS perfomance regression
2018-06-15 17:35:06 -04:00
David Norton b4fd65baf1 add digest logging 2018-06-15 16:55:59 -04:00
David Norton 57f97a72e6 fix SHOW TAG KEYS perfomance regression 2018-06-15 11:26:43 -04:00
Jacob Marble 544636c815 TSM: Fix ShouldCompactCache without WAL 2018-06-13 17:37:17 -07:00
Jacob Marble 0dc5393441 tsm/cache: Remove unused function parameter 2018-06-13 15:22:37 -07:00
Stuart Carnie 88cd9f3fcf pr(influx-tools): Improvements per PR review 2018-06-13 10:29:59 -07:00
Stuart Carnie 7e998779e6 feat(tsdb/store): Option to disable compactions for offline tools
Allows an offline tool to open the tsdb.Store with compactions disabled.
2018-06-13 10:29:59 -07:00
Stuart Carnie 7abf3ec048 fix(tsdb/store): Fix hang when closing Store if monitor is disabled 2018-06-13 10:29:59 -07:00
Edd Robinson 28b6df7afb Ensure remote read can handle no data in time 2018-06-12 23:10:18 +01:00
Ben Johnson cfaaf39d8b
Export Shard.Engine() 2018-06-04 13:25:03 -06:00
Jeff Wendling e6aec771b0 fix(tsdb): attempt to work on docker on windows
multiple users have attempted to run influxdb in a docker container
with a windows host and a volume mounted from windows. that causes
problems because it apparently uses samba/cifs which does not
support fsync on directories. this patchset will, if it receives an EINVAL
on directory fsync, as is what appears to happen on samba/cifs, then it
will ignore it. this should help.

fixes #9833.
fixes #9630.
2018-06-01 14:57:18 -06:00
Jacob Marble 9c4073ce75 tests: Fix OpenLimiter is nil 2018-06-01 11:20:44 -07:00
Jacob Marble 82551a70e7
Merge pull request #9921 from influxdata/jgm-escape
buildtsi: Do not escape measurement names
2018-06-01 08:32:01 -07:00
Jacob Marble 9a7b652a1c TSM: OpenLimiter must not be nil 2018-05-31 13:43:16 -07:00
Jacob Marble 44c5da060b buildtsi: Do not escape measurement names
When `influx_inspect buildtsi` is used to create a new `tsi1` index, spaces in measurement names are escaped, so measurement "a b" is changed to "a\ b".

This change modifies `models.ParseKeyBytes()` and `models.ParseName()` to unescape measurement names. `models.ParseKeyBytes()` returns unescaped tag keys, so this seems like the natural place to unescape measurement names.

Also followed `scanMeasurement()` to see what other code could be problematic, and this should be everything (the result of one other use of `scanMeasurement()` is later escaped).

Removed `tsdb.MeasurementFromSeriesKey()`. These methods are exported, so checked for side effects in other InfluxData repositories.
2018-05-30 15:20:56 -07:00
Ben Johnson cec2a2d988
Merge pull request #9918 from influxdata/bj-tsm-open-limiter
TSM1 Open Limiter
2018-05-30 13:13:14 -06:00
Stuart Carnie 0253f6fe05 fix(tsdb/engine/tsm1): Fix panic when closing cursor multiple times
Fixes #9909
2018-05-29 09:59:52 -07:00
Jacob Marble bb313765e4 tsdb/tsm1: Clean up TSM filename format/parse 2018-05-29 09:57:48 -07:00
Ben Johnson d3e3b05a49
Add tsm1 open limiter
This commit restricts the number of TSM1 files that can be opened
concurrently across the entire `tsdb.Store`. There is currently
a limit for the number of shards that can be opened concurrently,
however, this limit does not help when the number of CPU cores
is higher than the number of shards. Because TSM1 files have a 2GB
limit and there is no limit on the number of files per shard,
extremely large shards (1TB+) can load 1,000s of files simultaneously.
2018-05-29 10:21:53 -06:00
Jeff Wendling 2b3cd8406f
Merge pull request #9892 from influxdata/jmw-tombstone-notifications
tsdb: observe tombstone files as well
2018-05-24 09:56:09 -06:00
Stuart Carnie e3d7095d14 fix(tsm1): Avoid searching index if key outside index bounds
This improvement avoids performing a binary search on the index by
first checking the key against the lower and upper bounds. Particularly
useful for multiple, fully-compacted TSM files.
2018-05-23 13:29:49 -07:00
Jeff Wendling ce565965a4 tsdb: avoid nil checks on the observer
this avoids nil panics in the case that someone eventually forgets.
2018-05-23 13:15:41 -06:00
Jeff Wendling 8ad515b387 tsdb: remove the shard id again
callers can always ensure that the observer set on the engine options
is appropriate for that shard id. this simplifies the api and reduces
the chance of bugs due to mixing up shard ids.
2018-05-23 13:04:54 -06:00
Stuart Carnie e209a0a1f2 Restore "Performance optimization suggestions"
CLA confirmed
PR: https://github.com/influxdata/influxdb/pull/9836

This reverts commit 7215bad
2018-05-23 08:54:20 -07:00
Jeff Wendling 15ae0bd98d tsdb: observe tombstone files as well 2018-05-22 22:07:16 -06:00
Jeff Wendling e62b1a02fb
Merge pull request #9879 from influxdata/jmw-add-shard-number-to-observer
tsdb: add shard number to the observer
2018-05-21 20:00:47 -06:00