Commit Graph

12471 Commits (d474a0ed9cdc569c30bd7398240cb0c3de11d9e2)

Author SHA1 Message Date
Stuart Carnie c86dc0d103 redundant allocation is overwritten by line 1769 2017-08-17 11:12:41 -07:00
Stuart Carnie 823f903cc6 inputs are closed if Merge returns error and use <type>FinalizerIterator
* <type>FinalizerIterator sets a runtime finalizer and calls Close
  when garbage collected. This will ensure any associated cursors
  are closed and the associated TSM files released
* `query.Iterators#Merge` call could return an error and the inputs
  would not be closed, causing a cursor leak
2017-08-17 11:12:18 -07:00
Jason Wilder 9135b21efd Merge pull request #8714 from influxdata/jw-delete-deadlock
Fix deadlock when deleting measurement and writing to it
2017-08-16 17:30:40 -06:00
Jason Wilder a393458f4d Update changelog 2017-08-16 16:45:02 -06:00
Jason Wilder 85842503be Fix deadlock in engine/measurement fields
The OnReplace func ends up trying to acquire locks on MeasurementFields.  When
its called via snapshotting, this can deadlock because the snapshotting goroutine
also holds an RLock on the engine.  If a delete measurement calls is run at the
right time, it will lock the MeasurementFields and try to acquire a lock on the engine
to disable compactions.  This creates a deadlock.

To fix this, the OnReplace callback is moved to a function param to allow only Replace
calls as part of a compaction to invoke it as opposed to both snapshotting and compactions.

Fixes #8713
2017-08-16 16:43:40 -06:00
Edd Robinson 6b749f459e Merge pull request #8572 from influxdata/er-log-response
Log server error response messages
2017-08-16 23:17:57 +01:00
Jonathan A. Sternberg 0a182a0df7 Merge pull request #8712 from influxdata/js-enhance-condition-parsing
Remove TimeRange function and replace with a more accurate ConditionExpr function
2017-08-16 17:10:30 -05:00
Jonathan A. Sternberg 697759613c Remove time comparisons from the inner sections of the storage engine 2017-08-16 16:51:13 -05:00
Jonathan A. Sternberg 8bd04ebe39 Remove TimeRange function and replace with a more accurate ConditionExpr function
The ConditionExpr function is more accurate because it parses the
condition and ensures that time conditions are actually used correctly.
That means that attempting to combine conditions with OR will not result
in the query silently pretending it's an AND and nested conditions work
correctly so there is only one way to read the query.

It also extracts the non-time conditions into a separate condition so we
can stop attempting to parse around the time conditions in lower layers
of the storage engine. This change does not remove those hacks, but a
following commit should be able to sanitize the condition and remove
them.
2017-08-16 16:45:35 -05:00
Edd Robinson a1d5913329 Log server error response messages
This commit provides more insight into server errors by both setting
the error on a response header, and, in the case of server errors (5xx),
logging those error messages to the HTTPD log, if [http] log_enabled =
true.
2017-08-16 21:32:58 +01:00
Jason Wilder 3e1ce97d3b Merge pull request #8711 from influxdata/jw-monitor-writes
Batch up writes for monitor service
2017-08-16 14:20:56 -06:00
Jonathan A. Sternberg 204d60c62b Merge pull request #8703 from influxdata/js-separate-influxql-and-query-engine
Separate the query engine into a separate package
2017-08-16 14:22:29 -05:00
Jason Wilder ce90eca4a6 Update changelog 2017-08-16 13:13:40 -06:00
Jason Wilder c8ba179731 Batch up writes for monitor service
The monitor service was writing one big batch for all stats.  If this
batch was large, it causes some slower and more expensive write paths
to be taken that incur a lot of memory allocations.  This changes the
monitor service to write in batches of up to 5000 points which should
avoid the slower paths.
2017-08-16 13:09:25 -06:00
Jonathan A. Sternberg 9a2357c2c0 Separate the query engine into a separate package
This change provides a clear separation between the query engine
mechanics and the query language so that the language can be parsed and
dealt with separate from the query engine itself.
2017-08-16 13:38:43 -05:00
Stuart Carnie 59e137e543 Merge pull request #8706 from influxdata/sgc-cursor-leak
fix: cursor leak when cur == nil and aux or conds is not empty
2017-08-16 10:08:27 -07:00
Stuart Carnie 3caeee8a24 fix: cursor leak when cur == nil and aux or conds is not empty 2017-08-16 09:17:20 -07:00
Ben Johnson 61ed57f705 Merge pull request #8636 from benbjohnson/show-cardinality
SHOW CARDINALITY
2017-08-16 10:02:06 -06:00
Ben Johnson e0d8cb0ef3
Cardinality AST, parser, & rewriter fixes. 2017-08-16 09:27:29 -06:00
Ben Johnson 60ab1282ea
Refactor system iterators.
Previously pseudo iterators could be created for meta data such
as series, measurement, and tag data. These iterators were created
at a higher level and lacked a lot of the power of the query engine.

This commit moves system iterators down to the series level and
supports the following:

	- _name
	- _seriesKey
	- _tagKey
	- _tagValue
	- _fieldKey

These can be used as normal fields such as:

	SELECT _seriesKey FROM cpu

This will return all the series keys for `cpu`.
2017-08-16 09:27:29 -06:00
Ben Johnson c9b5d60753
Parse SHOW CARDINALITY. 2017-08-16 09:27:15 -06:00
Ben Johnson c4e2ba25c3 Merge pull request #8669 from benbjohnson/1392-tsi-index-migration
TSI Index Migration Tool
2017-08-16 09:16:03 -06:00
David Norton 9f74c0fff9 Merge pull request #8704 from influxdata/dn-8677-fix-backup
fix #8677: check for snapshot size == 0
2017-08-16 09:57:46 -04:00
David Norton 1d8d739418 fix #8677: check for snapshot size == 0 2017-08-16 09:43:56 -04:00
Jason Wilder 186e44d227 Merge pull request #8702 from influxdata/jw-monitor-cpu
Reduce CPU usage when checking series cardinality
2017-08-15 16:02:17 -06:00
Jason Wilder a4f6771cb9 Merge pull request #8701 from influxdata/jw-drop-measurement
Fix drop measurement not dropping all data
2017-08-15 14:32:06 -06:00
Jason Wilder b7b11811ce Update changelog 2017-08-15 12:21:24 -06:00
Jason Wilder c74932de94 Limit shard cardinality checks to 1 per database
The tag cardinality checks were run for all inmem shards.  Since inmem
shards share the same index, a lot of the work is redundant.  Inmem shards
also need to sort their measurmenet and tag keys which can be CPU intensive
with many shards or higher cardinality.

This changes the monitoring to just check one shard in each database which
should lower CPU usage due to excessive sorting.  The longer term solution
is to use TSI which would not have this check or required sorting.
2017-08-15 12:17:18 -06:00
Jason Wilder 21f6ed2c2e Update changelog 2017-08-15 12:03:01 -06:00
Ben Johnson 06bc3b6fbf
TSI Index Migration 2017-08-15 11:40:24 -06:00
Jason Wilder 90e2cadeb6 Fix drop measurement not dropping all data
If there were multiple shards, drop measurement could update the index
and remove the measurement before the other shards ran their deletes.
This causes the later shards to not see any series to delete.

The fix is to all deleteSeries to handle the index delete which already
accounts for removing the measurement when it is fully removed from the
index.
2017-08-15 11:19:45 -06:00
Jason Wilder 3fb7941430 Merge pull request #8698 from influxdata/jw-compact
Reduce CPU usage for some compactions
2017-08-14 19:44:33 -06:00
Jason Wilder 61b13eb12b Fix partiallyRead logic
The partiallyRead func didn't account for the initial values and would
return true for blocks that had not been read at all.  This causes a
slower path during compactions that forces a block to be decoded when
it could just be merged as is without decoded.  This causes compactions
to consume more CPU and run slower at times.
2017-08-14 16:44:32 -06:00
Edd Robinson 442581d299 Merge pull request #8592 from influxdata/er-mutex-profile
Adds mutex profile
2017-08-14 22:09:19 +01:00
Edd Robinson 81c06b58fa Merge pull request #8462 from xginn8/backup_stdout
backup output should go to stdout not stderr
2017-08-14 22:08:25 +01:00
Edd Robinson 45969ef3c6 Allow tag filtering when using DELETE with tsi1 2017-08-14 19:09:36 +01:00
Joe LeGasse 9e0e62323a Merge pull request #8680 from influxdata/jl-meta-auth
auth: apply FGA to SHOW SERIES
2017-08-11 12:48:31 -04:00
Jonathan A. Sternberg 6d94714e83 Merge pull request #8674 from mattnenterprise/strings-test
Test slices strings Exists* functions
2017-08-09 21:32:10 -05:00
Stuart Carnie 50f7a7f3f0 Merge pull request #8681 from influxdata/sgc-1341
fixes a memory leak when NewReaderIterator creates a nilFloatIterator
2017-08-09 14:57:52 -07:00
Stuart Carnie f2d0142d83 release io.Reader 2017-08-09 14:56:24 -07:00
Stuart Carnie bf30282e53 update CHANGELOG 2017-08-09 14:53:14 -07:00
Stuart Carnie 91e7aaee09 fixes a memory leak when NewReaderIterator creates a nilFloatIterator 2017-08-09 14:46:44 -07:00
Joe LeGasse 1121b69a9e auth: apply FGA to SHOW SERIES 2017-08-09 14:56:53 -04:00
Matt McCoy e43bec4a3a Test slices strings Exists* functions 2017-08-08 20:33:26 -04:00
Edd Robinson 8934aacebb Adds mutex profile
Mutex profiles are now available via the:

  - /debug/pprof/mutex
  - /debug/pprof/all

endpoints.
2017-08-04 14:36:39 +01:00
Edd Robinson 392fa03cf3 Merge pull request #8660 from influxdata/er-8640-show-tag-values
Improve performance of SHOW TAG VALUES
2017-08-03 17:25:59 +01:00
Edd Robinson 0f648e5170 Remove unsafe shenanigans 2017-08-03 16:38:05 +01:00
Edd Robinson 7c67718d60 Update CHANGELOG 2017-08-02 18:19:04 +01:00
Edd Robinson 2d57b599e9 Remove debugging statement 2017-08-02 17:24:00 +01:00
Edd Robinson da676a79ae Implement TSI iterator 2017-08-02 16:29:14 +01:00