Commit Graph

12295 Commits (e91d38b11799d71aa34b52117a820969b3b173b1)

Author SHA1 Message Date
Jonathan A. Sternberg e91d38b117 Merge pull request #8730 from influxdata/js-refactor-select-tests
Refactor the select tests to use subtests and fewer functions
2017-08-23 10:02:36 -05:00
Edd Robinson e24ff1d13c Merge pull request #8619 from influxdata/er-8611-request-id
Support pre-existing request ID headers
2017-08-23 14:46:05 +01:00
Jonathan A. Sternberg 966e845c03 Refactor the select tests to use subtests and fewer functions
This will allow refactoring the query engine and the select statement
more easily since fewer code locations will need to be changed. It also
reduces the amount of code while still keeping individual tests that are
filterable.
2017-08-23 08:21:49 -05:00
Edd Robinson 64933fea17 Support pre-existing request ID headers
Other applications or services sometimes expose a header containing a
unique ID, which can then be included in logging or response information
to allow an operator to link inter-service requests. The most common
header name used by services in the wild appears to be `X-Request-ID`,
but `Request-Id` is also used.

This commit adds support for specifying either `X-Request-ID` or
`Request-Id` headers, which will then be used by InfluxDB when logging
request information, and also in the `X-Request-ID` and `Request-Id`
response headers.

We populate both `X-Request-ID` and `Request-Id` to maintain backwards
compatibility with previous version, and to support the more common
`X-Request-ID` header name.

If both `X-Request-ID` and `Request-Id` are specified, then
`X-Request-ID` is used.

If neither header is specified, then in line with previous behaviour, we
generate a v1 UUID.
2017-08-23 13:42:33 +01:00
Edd Robinson 36ed3cbb22 Merge pull request #8685 from influxdata/er-8663-tsi1-tests
Run relevant unit tests on both indexes
2017-08-23 12:17:08 +01:00
Edd Robinson d011e43a1b Address feedback 2017-08-23 10:47:01 +01:00
Edd Robinson a5f4b929c9 Ensure Skip is called in test goroutine 2017-08-23 10:47:01 +01:00
Edd Robinson 74297a38d6 CHANGELOG 2017-08-23 10:47:01 +01:00
Edd Robinson 9be7c5aaa6 Run relevant engine tests on both indexes 2017-08-23 10:47:01 +01:00
Edd Robinson 9c12607c3e Ensure shard tests run with both indexes 2017-08-23 10:46:59 +01:00
Edd Robinson e732cb7a39 Update benchmarks to use sub-benchmarks 2017-08-22 17:51:48 +01:00
Edd Robinson dd808bb77a Ensure TSI tests run with TSI index 2017-08-22 17:51:48 +01:00
Edd Robinson bca4393494 Run most tests for both indexes 2017-08-22 17:51:48 +01:00
Edd Robinson f64f6c5d34 Ensure all tests are ran for both indexes 2017-08-22 17:39:45 +01:00
Edd Robinson 84aea2718a Reduce noise in test logs
This commit reduces noise in the test logs by adding a -vv flag, and
silencing server log output, even when verbose testing mode is enabled.

Verbose testing mode (-v) is useful for seeing where sub-tests may be
failing, but it's currently too noisy with the server logs.

The -vv flag can now be used to see all server output. The flag should
be placed _after_ the package you're testing, e.g.,

    go test github.com/influxdata/influxdb/tests -vv
2017-08-22 17:39:45 +01:00
Edd Robinson aacdb9bed2 Convert tests to use sub-tests 2017-08-22 17:39:45 +01:00
Jason Wilder d305b89f74 Merge pull request #8726 from influxdata/jw-tsm-file-leak
Fix leaking tmp file when large compaction aborted
2017-08-22 09:59:23 -05:00
Stuart Carnie 2ef9b489f0 Merge pull request #8727 from influxdata/sgc-finalizer
log message when iterator is closed by finalizer
2017-08-22 07:29:38 -07:00
Stuart Carnie d189621d07 log message when iterator closed by finalizer 2017-08-21 16:46:24 -07:00
Jason Wilder e265d150be Fix leaking tmp file when large compaction aborted
If a large compaction was running and was aborted. It could would leave
some tmp files around for files that it had fully written.  The current
active file was cleaned up, but already completed ones would not.  This
would occur when a TSM file needed to rollover due to size.
2017-08-21 17:04:57 -06:00
Jonathan A. Sternberg 5ce6007347 Merge pull request #8724 from influxdata/js-remove-unused-cursor
This cursor implementation appears to be completely unused
2017-08-21 17:44:51 -05:00
Jonathan A. Sternberg c0f7a8af5b This cursor implementation appears to be completely unused
Remove it so that its existence doesn't confuse someone that this is
actually the cursor. The real cursors appear to be in file_store.gen.go.
2017-08-21 16:27:23 -05:00
Stuart Carnie abf87f8373 Merge pull request #8716 from influxdata/sgc-finalizers
Ensure inputs are closed on error. Add runtime GC finalizer as additional guard to close iterators
2017-08-18 07:41:43 -07:00
Stuart Carnie 25edd7bfdf naming 2017-08-17 15:47:47 -07:00
Stuart Carnie 4233763321 update CHANGELOG 2017-08-17 11:12:48 -07:00
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