Commit Graph

1944 Commits (b61b030b8ccabc8aa9df9af2ff6c33f4a304b901)

Author SHA1 Message Date
Ben Johnson bd2963dc05 Merge pull request #8735 from influxdata/er-8695-iterators
Ensure that sorted heaps are merged correctly
2017-08-24 08:45:16 -06:00
Edd Robinson 8c4686fb1b Ensure that sorted heaps are merged correctly
When merging streams of system iterators we don't use tags or time.
Instead we add series keys (in the case of, for example, `SHOW SERIES`)
to the `Aux` field of the iterators' elements. This is because we only
emit merged and sorted sets of series key to the client.

We currently use `SortedMergeHeap`s to merge together multiple
iterators, and the comparitor function did not consider `Aux` fields
when determining which heap to pop the next item off during a merge. As
such, `SHOW SERIES` and `SHOW TAG KEYS` (any meta query that gets
converted into a special type of `SELECT`) were returning results in
arbitrary order.

This issue was never noticed on the `inmem` index because the streams
are always duplicates of each other, and of course it doesn't matter if
you arbitrarily merge together two idential, sorted streams...

The issue first manifested itself on the `tsi1` index, but this fix will
apply to both indexes.
2017-08-23 17:21:24 +01:00
Edd Robinson 6e3b8d4684 Merge branch 'master' into er-8668-toml 2017-08-23 17:16:31 +01: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 45a6e53d7b Bump toml parser to relicensed MIT version 2017-08-23 11:00:31 +01:00
Edd Robinson 74297a38d6 CHANGELOG 2017-08-23 10:47:01 +01: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
Stuart Carnie 4233763321 update CHANGELOG 2017-08-17 11:12:48 -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
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 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 ce90eca4a6 Update changelog 2017-08-16 13:13:40 -06: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 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 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 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 b7b11811ce Update changelog 2017-08-15 12:21:24 -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
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
Stuart Carnie bf30282e53 update CHANGELOG 2017-08-09 14:53:14 -07: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 7c67718d60 Update CHANGELOG 2017-08-02 18:19:04 +01:00
Stuart Carnie 6311a19ad4 update CHANGELOG 2017-08-01 10:20:05 -07:00
Jonathan A. Sternberg fcc5184a81 Merge pull request #8642 from influxdata/js-8639-parse-time-literals-with-location
Parse time literals using the time zone in the select statement
2017-07-28 12:35:50 -05:00
Ryan Betts df88fa3736 Update CHANGELOG with 1.3 release dates. 2017-07-27 16:23:22 -07:00
Jason Wilder 85642e2831 Merge pull request #8630 from influxdata/jw-drop-oom
Prevent excessive memory usage when dropping series
2017-07-27 16:24:52 -06:00
Jason Wilder 6e6cc991ee Merge pull request #8629 from influxdata/jw-compaction-abort
Interrupt in progress TSM compactions
2017-07-27 16:12:40 -06:00
Jason Wilder c75ac3076f Limit delete to run one shard at a time
There was a change to speed up deleting and dropping measurements
that executed the deletes in parallel for all shards at once. #7015

When TSI was merged in #7618, the series keys passed into Shard.DeleteMeasurement
were removed and were expanded lower down.  This causes memory to blow up
when a delete across many shards occurs as we now expand the set of series
keys N times instead of just once as before.

While running the deletes in parallel would be ideal, there have been a number
of optimizations in the delete path that make running deletes serially pretty
good.  This change just limits the concurrency of the deletes which keeps memory
more stable.
2017-07-27 16:01:47 -06:00
Jason Wilder 18a02d50d7 Interrupt in progress TSM compactions
When snapshots and compactions are disabled, the check to see if
the compaction should be aborted occurs in between writing to the
next TSM file.  If a large compaction is running, it might take
a while for the file to be finished writing causing long delays.

This now interrupts compactions while iterating over the blocks to
write which allows them to abort immediately.
2017-07-27 15:58:56 -06:00
Jonathan A. Sternberg 950753d036 Parse time literals using the time zone in the select statement 2017-07-27 13:05:51 -05:00
Jonathan A. Sternberg 343cd2e120 Fix time zone shifts when the shift happens on a time zone boundary
When a time zone shift happened at the edge of a time bucket, the logic
was incorrect. When we added an hour to the day with a time grouping of
2 hours, we took the hour away from the previous bucket instead of the
next bucket so the first bucket of the day would be from midnight to 1
AM and the second bucket would include 1 AM to 4 AM (2 AM to 3 AM does
not exist when shifting forwards). The correct buckets should have been
12 AM to 2 AM for the first bucket of the day and 3 AM to 4 AM for the
second (since 2 AM to 3 AM does not exist).

This also modifies the tests to use table tests and sub tests.
2017-07-25 23:36:03 -05:00
Connor Peet 4459e1e8d8 Return errors in CSV responses 2017-07-25 09:44:02 -05:00
Jonathan A. Sternberg 8bb80321d9 Merge pull request #8561 from influxdata/js-8525-query-http-pipelining
Support http pipelining for /query endpoint
2017-07-21 11:15:28 -05:00
Jonathan A. Sternberg 506c06241b Fixed time boundaries for continuous queries with time zones
This calculates the start and end time along with any time zones shifts
so that continuous queries are run at the correct time when a time zone
is included in the query.
2017-07-20 14:30:52 -05:00
Jonathan A. Sternberg 39591e5375 Support http pipelining for /query endpoint
Removing the forced `Connection: close` header from the `/query`
endpoint. This was originally added because of golang/go#13165, but it
seems like it's possible to use pipelining with go 1.8 and http 1.1,
just not recommended.

After some testing, it appears that the channel returned by
`ResponseWriter.CloseNotify()` will not send a value if the connection
was not interrupted. We already account for this in /query by exiting
from the goroutine if the request has finished by signaling another
channel.

Since the handler already accounts for the possibility that the channel
will not signal and since `CloseNotify()` doesn't interfere with a
pipelined request, we can remove the forced `Connection: close` that was
added to force clients to establish a new connection.
2017-07-20 09:38:01 -05:00
Jonathan A. Sternberg f7d07910aa Fix the cq start and end times to use unix timestamps
The Go timestamp leads Truncate to start a week on Monday, but the query
engine uses unix timestamps which has the week start on a Thursday.

Updating the service so it uses a custom truncate method that uses the
unix timestamp instead of `time.Time`.

Fixes #8569.
2017-07-17 14:59:45 -05:00
xginn8 faec9625bc Merge branch 'master' into backup_stdout 2017-07-13 18:10:54 -04:00
Jason Wilder 4244d0e053 Merge pull request #8568 from influxdata/jw-tombstone-compress
Compress tombstone files
2017-07-10 11:28:09 -06:00
Jason Wilder c25f7b8b3f Fix duplicate points returned after delete
The sortedSeriesIds slice was not getting reset to 0 which caused
the same series ids to exist in the slice more than once.  Since
the size of the slice never matched the size of the seriesID map,
it kept appendending to the slice and sorting it which cause multiple
cursor to get created for the same series.

Fixes #8531
2017-07-10 10:37:01 -06:00
Stuart Carnie 649beba8b3 update CHANGELOG 2017-07-08 08:46:27 -07:00
Adam 7ac4f5b8c2 Merge pull request #8574 from influxdata/plutonium#1240_master
Add X-Influxdb-Build  value to HTTP response header
2017-07-07 12:04:58 -04:00
Edd Robinson d2ce7060c5 Merge branch 'master' into backup_stdout 2017-07-07 16:27:39 +01:00
Edd Robinson 0d7059af04 Update CHANGELOG 2017-07-07 16:23:38 +01:00
Edd Robinson a43238618e Merge pull request #8512 from axiomhq/loglogbeta
Switch to LogLog-Beta Cardinality estimation
2017-07-07 16:14:16 +01:00
Adam 460b30bd08 removed blank line from changelog 2017-07-07 11:06:01 -04:00