Commit Graph

12471 Commits (d474a0ed9cdc569c30bd7398240cb0c3de11d9e2)

Author SHA1 Message Date
Jason Wilder 739ecd2ebd Fix a compaction planning bug
There was a race where the plan returned was for files that were just
compacted so the compaction would immediately abort.
2017-09-11 15:26:25 -06:00
Jason Wilder bc4fb0ea10 Sort index entries if necessary
These are already sorted during compaction, so switch to sorting lazily
to avoid the CPU and allocations.  This would only occur when using if
using the writer directly.
2017-09-11 15:26:25 -06:00
Jason Wilder a9e89ede75 Reduce lock contenton on Index
Stat and Size are read-only and can take an RLock.
2017-09-11 15:26:25 -06:00
Jason Wilder f18dec6a4a Use sorted slice for writing TSM index
The directIndex used by the TSMWriter maintained a map of series keys
to index entries.  When the index is written to the TSM file, the keys
are sorted and then written out in order.

The reason for this is because directIndex used to be the only index
and it was optimized more for reading.  The reading has been replaced
by the indirectIndex so the map of keys ends up wasting space.

During compactions, the series keys (and index entries) are already sorted
so this change uses the sorting to avoid the map and sort when writing the
index.  This reduces allocations and CPU usage quite a bit for larger cardinality
TSM files.
2017-09-11 15:26:24 -06:00
Jason Wilder 2a0d7935d7 Switch level 3 compactions to use fast compaction strategy
This leaves the slower compactions that create full blocks to only
the full compaction.  This helps reduce CPU usage and memory while shards
are hot, but increases disk usage (reduced compression) slightly.
2017-09-11 15:26:24 -06:00
Jason Wilder 4009223fb6 Avoid allocating murmur3.Hash too frequently
These hashes were getting allocate very frequently with high cardinality
datasets.  This allows them to be re-used.
2017-09-11 15:26:24 -06:00
Jason Wilder 0e81743f33 Merge pull request #8801 from influxdata/jw-drop-series
Reduce lock contention when deleting high cardinality series
2017-09-11 08:07:41 -06:00
Jason Wilder 94e229ff59 Merge branch 'master' into jw-drop-series 2017-09-08 15:34:32 -06:00
Jason Wilder 44e1d3f185 Merge pull request #8804 from influxdata/jw-wal-oom
Fix increased memory usage in cache and wal
2017-09-08 15:10:53 -06:00
Jason Wilder 78922f9821 Set rc to nil when closing WALSegmentReader 2017-09-08 14:55:02 -06:00
Joe LeGasse 76c3f7643b Merge pull request #8807 from influxdata/jl-meta-auth
auth: apply series auth to TSI
2017-09-08 14:10:13 -04:00
Jonathan A. Sternberg 9cbd604603 Fix time constraints in subqueries from the refactor 2017-09-08 11:55:53 -05:00
Joe LeGasse 4fb35b373b auth: apply series auth to TSI 2017-09-08 09:09:53 -04:00
Jason Wilder 7d05601ba5 Update changelog 2017-09-07 16:52:00 -06:00
Jason Wilder b9b648e2a0 Dynamically allocate cache store
The cache store can be memory intensive with many shards.  This
lazyily allocates it when needed and frees it when the cache is
empty and cold.
2017-09-07 16:35:08 -06:00
Paul Dix 975655af9b Merge pull request #8802 from influxdata/pd-changelog-for-from
Update CHANGELOG with Prometheus feature
2017-09-07 17:52:37 -04:00
Jason Wilder 5581f8b4ae Re-use WALSegmentReaders at startup 2017-09-07 12:56:17 -06:00
Jason Wilder e39276b96f Skip reading 0 byte wal segments 2017-09-07 12:24:54 -06:00
Paul Dix 2e3c0a8171 Update CHANGELOG with Prometheus feature 2017-09-07 13:55:12 -04:00
Paul Dix f30eba380e Add support for Prometheus remote read and write API. (#8784)
Adds a new package prometheus for converting from remote reads and writes to Influx queries and points. Adds two new endpoints to the httpd handler to support prometheus remote read at /api/v1/prom/read and remote write at /api/v1/prom/write.

The only thing used from Prometheus is the storage/remote files that are generated from the remote.proto file. Copied that file into promtheus/remote package to avoid an extra dependency.
2017-09-07 13:52:37 -04:00
Jason Wilder a3ab827e2e Update changelog 2017-09-07 11:46:32 -06:00
Jason Wilder a8d9eeef36 Reduce lock contention when deleting high cardinality series
Deleting high cardinality series could take a very long time, cause
write timeouts as well as dead lock the process.  This fixes these
issue to by changing the approach for cleaning up the indexes and
reducing lock contention.

The prior approach delete each series and updated every index (inmem)
during the delete.  This was very slow and cause the index to be locked
while it items in a slice were removed one by one.  This has been changed
to mark series as deleted and then rebuild the index asynchronously which
speeds up the process.

There was also a dead lock that could occur when deleing the field set.
Deleting the field set held a write lock and the function it invoked under
the lock could try to take a read lock on the field set.  This would then
deadlock.  This approach was also very slow and caused time out for writes.
It now uses faster approach that checks for the existing of the measurment
in the cache and filestore which does not take write locks.
2017-09-07 11:36:02 -06:00
Jonathan A. Sternberg e18425757d Merge pull request #8791 from influxdata/js-explain-cached-values
Include the number of scanned cached values in the iterator cost
2017-09-06 16:00:30 -05:00
Jonathan A. Sternberg 590be193e5 Include the number of scanned cached values in the iterator cost 2017-09-06 15:41:07 -05:00
Stuart Carnie 2f4315ccdf Merge pull request #8790 from influxdata/sgc-8787
Fixes #8787
2017-09-05 11:47:24 -07:00
Stuart Carnie aa6ef36051 update CHANGELOG 2017-09-05 11:22:18 -07:00
Stuart Carnie 4a6114028c exported UnloadIndex checks for ready state 2017-09-05 11:22:13 -07:00
kun 8a283e248c Correctly check if the Shard is ready for queries or writes 2017-09-03 15:14:58 +08:00
Jonathan A. Sternberg 091ea5f9a5 Merge pull request #8776 from influxdata/js-explain-plan
Initial implementation of explain plan
2017-09-01 16:19:37 -05:00
Edd Robinson 51e886ba66 Merge pull request #8757 from oiooj/pr-cl
Fix panic when the engine already closed in a shard
2017-09-01 16:59:12 +01:00
Jonathan A. Sternberg 50d404e690 Initial implementation of explain plan
It prints the statistics of each iterator that will access the storage
engine. For each access of the storage engine, it will print the number
of shards that will potentially be accessed, the number of files that
may be accessed, the number of series that will be created, the number
of blocks, and the size of those blocks.
2017-09-01 09:01:10 -05:00
Jonathan A. Sternberg 006c8193a9 Merge pull request #8595 from emluque/6563-CancelQuery
#6563 Support Ctrl+C to cancel a running query in the Influx CLI
2017-09-01 08:14:48 -05:00
emluque fa681edcb9 6563 Support Ctrl+C to cancel a running query in the Influx CLI
Solved the issue by using context on the http request on the client.
2017-09-01 08:02:27 -05:00
Jonathan A. Sternberg 0ef033f5dd Merge pull request #8770 from influxdata/js-reduce-walk-refs-memory-usage
Reduce how long it takes to walk the varrefs in an expression
2017-08-31 10:15:03 -05:00
Jonathan A. Sternberg 466fc9026e Reduce how long it takes to walk the varrefs in an expression
This is used quite a bit to determine which fields are needed in a
condition. When the condition gets large, the memory usage begins to
slow it down considerably and it doesn't take care of duplicates.
2017-08-31 09:33:45 -05:00
Joe LeGasse 732a0c2eaa Merge pull request #8769 from influxdata/jl-map-cleanup
cleanup: remove poor usage of ',ok' with maps
2017-08-31 09:18:42 -04:00
Ben Johnson 57d42ac4af Merge pull request #8752 from benbjohnson/1479-meta-queries
Use system cursors for measurement, series, and tag key meta queries.
2017-08-30 08:35:35 -06:00
Ben Johnson 1dbe0662d8
Use system cursors for measurement, series, and tag key meta queries. 2017-08-30 08:35:20 -06:00
David Norton 0da711675f Merge pull request #8764 from influxdata/dn-8638-influx_inspect
fix #8638: inspect shouldn't err on missing file
2017-08-30 10:21:22 -04:00
David Norton 2aa446bf24 fix #8638: inspect shouldn't err on missing file
influx_inspect walks the data and wal directories building a list of
files to export. It then opens, reads, and exports each. If the file was
deleted between the time it was added to the list and the time the
inspect tool attempts to read it, the file is now skipped without
emitting an error.
2017-08-30 09:59:03 -04:00
Joe LeGasse a95647b720 cleanup: remove poor usage of ',ok' with maps
There are several places in the code where comma-ok map retrieval was
being used poorly. Some were benign, like checking existence before
issuing an unconditional delete with no cleanup. Others were potentially
far more serious: assuming that if 'ok' was true, then the resulting
pointer retrieved from the map would be non-nil. `nil` is a perfectly
valid value to store in a map of pointers, and the comma-ok syntax is
meant for when membership is distinct from having a non-zero value.
There was only one or two cases that I saw that being used correctly for
maps of pointers.
2017-08-30 09:49:31 -04:00
Stuart Carnie dd01132937 Merge pull request #8766 from influxdata/sgc-inmem-deadlock
Fix deadlock when calling `SeriesIDsAllOrByExpr`
2017-08-29 16:38:43 -07:00
Stuart Carnie 9f7f225c10 update CHANGELOG 2017-08-29 16:16:10 -07:00
Stuart Carnie 51eb85193c release lock to avoid dead lock when calling WalkWhereForSeriesIDs
* WalkWhereForSeriesIDs may call SeriesIDs, which may attempt to
  upgrade from a `RLock` to a `Lock`, causing the dead lock
2017-08-29 16:12:51 -07:00
Stuart Carnie 1b69928054 Merge pull request #8755 from influxdata/sgc-inmem-race
fix race condition reading seriesByID map
2017-08-29 07:41:46 -07:00
kun 5d5225e77d Fix panic when engine closed in a shard 2017-08-29 17:22:45 +08:00
Stuart Carnie 4129c2a606 Merge branch 'master' into sgc-inmem-race 2017-08-28 15:49:10 -07:00
Jonathan A. Sternberg 10ad7ae6a0 Merge pull request #8754 from influxdata/js-8699-force-subqueries-to-match-ordering
Force subqueries to match the parent queries ordering
2017-08-28 16:12:58 -05:00
Jonathan A. Sternberg 1c7bafcd3e Force subqueries to match the parent queries ordering
Previously, subqueries would honor their own ordering. We never really
supported that and I have no idea if it would work since most parts in
the query engine assume that points are being delivered in only one
ordering.

Subqueries have now been modified so if a person tries to do different
ordering, they get an error when running the query. If they specify an
ordering in the top most query, that ordering gets propagated to all
subqueries.

Fixes #8699.
2017-08-28 15:57:40 -05:00
Stuart Carnie 7a1a3ebe04 update CHANGELOG 2017-08-28 13:39:18 -07:00