Commit Graph

12348 Commits (f30eba380e089548da8025cf08fb5c3628d1a1b4)

Author SHA1 Message Date
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 ac2a9690a1 Merge pull request #8610 from influxdata/js-8607-time-zone-shifts
Fix time zone shifts when the shift happens on a time zone boundary
2017-07-27 13:05:29 -05:00
Jonathan A. Sternberg 2ac0dc98c6 Merge pull request #8641 from jheusser/patch-1
Update udp port in README to be in valid range
2017-07-27 13:02:57 -05:00
Jonathan Heusser c38d0de99d Update udp port to be in valid range
`80891` is not a valid port, changed to `8189`.
2017-07-27 13:26:37 +01:00
Stuart Carnie c86e94af37 Merge pull request #8635 from influxdata/sgc-xxhash
update xxhash and use Sum64String to avoid allocs
2017-07-26 14:01:37 -07:00
Stuart Carnie 0c79ec6f17 update xxhash and use Sum64String to avoid allocs
```
± benchcmp ring_before.txt ring_after.txt
benchmark                             old ns/op     new ns/op     delta
BenchmarkRing_getPartition_100-8      108           48.1          -55.46%
BenchmarkRing_getPartition_1000-8     113           48.9          -56.73%

benchmark                             old allocs     new allocs     delta
BenchmarkRing_getPartition_100-8      1              0              -100.00%
BenchmarkRing_getPartition_1000-8     1              0              -100.00%

benchmark                             old bytes     new bytes     delta
BenchmarkRing_getPartition_100-8      192           0             -100.00%
BenchmarkRing_getPartition_1000-8     192           0             -100.00%
```
2017-07-26 10:16:54 -07: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
Jonathan A. Sternberg fe1167cc44 Merge pull request #8097 from connor4312/return-errors-in-csv
Return errors in CSV responses
2017-07-25 10:05:12 -05:00
Connor Peet 4459e1e8d8 Return errors in CSV responses 2017-07-25 09:44:02 -05:00
Jonathan A. Sternberg 6b616d57c6 Merge pull request #8616 from influxdata/js-influxql-google-cmp
Switch influxql to use google/go-cmp to compare the point structs
2017-07-24 14:48:03 -05:00
Stuart Carnie 6e1f830ecb Merge pull request #8615 from influxdata/sgc-uint-engine
uint64 support for storage layer
2017-07-24 10:07:07 -07:00
Stuart Carnie d243df5ca3 simplify loop 2017-07-24 09:03:22 -07:00
Stuart Carnie eec80692c4 Taught tsm1 storage engine how to read and write uint64 values
* introduced UnsignedValue type
  * leveraged existing int64 compression algorithms (RLE, Simple 8B)
* tsm and WAL can read and write UnsignedValue
* compaction is aware of UnsignedValue
* unsigned support to model, cursors and write points

NOTE: there is no support to create unsigned points, as the line
protocol has not been modified.
2017-07-24 09:03:22 -07:00
Edd Robinson 4a87662d60 Merge pull request #8621 from influxdata/er-go1.8-appveyor
Ensure Windows builds tested with Go 1.8
2017-07-24 16:28:43 +01:00
Edd Robinson e7f4b556fa Ensure Windows builds tested with Go 1.8 2017-07-24 13:56:19 +01:00
Jonathan A. Sternberg 8609c2c02a Switch influxql to use google/go-cmp to compare the point structs
The diff will improve the debug message when a test fails. Right now,
the message is unreadable. The diff message from go-cmp is much better.
2017-07-21 14:05:27 -05:00
Jason Wilder 62534ce5c1 Merge pull request #8617 from influxdata/jw-go-19
Add go1.9 and tsi builders to circle
2017-07-21 13:03:49 -06:00
Jason Wilder 2c33919f9c Add build for go 1.9 2017-07-21 12:37:52 -06:00
Jason Wilder 01145d4e7e Add builder for tsi tests 2017-07-21 11:48:51 -06: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 25e82d0e0e Merge pull request #8606 from influxdata/js-8601-cq-time-zones
Accomodate for time zones with continuous query scheduling
2017-07-20 16:44:03 -05:00
Jonathan A. Sternberg fd4e16dd02 Merge pull request #8613 from influxdata/js-8563-update-client-readme
Correct the client package README
2017-07-20 16:37:49 -05:00
Jonathan A. Sternberg 206fff70c6 Correct the client package README
Fixes #8563.
2017-07-20 14:56:04 -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 a8f3fbf57e Merge pull request #8609 from influxdata/js-8480-default-stats-interval
Regenerate influxql package for #8480
2017-07-19 18:51:24 -05:00
Jonathan A. Sternberg 4f5423f90e Regenerate influxql package for #8480 2017-07-19 14:24:40 -05:00
Ryan Betts 0caa966f55 Merge pull request #8564 from influxdata/ryan-1426-reactlicense
Remove react library from dependencies licenses
2017-07-19 09:13:02 -04:00
Jonathan A. Sternberg 8dfd1f8c7c Merge pull request #8600 from influxdata/js-cq-interval-start
Fix the cq start and end times to use unix timestamps
2017-07-17 16:43:44 -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 c97bc4db5a Merge pull request #8579 from influxdata/jw-dup-points
Fix duplicate points returned after delete
2017-07-10 10:51:52 -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 05f9977295 Merge pull request #8580 from influxdata/sgc-8500-deadlock
Free RLock prior to returning
2017-07-10 09:26:34 -07:00
Stuart Carnie 649beba8b3 update CHANGELOG 2017-07-08 08:46:27 -07:00
Stuart Carnie 2ccdda72a1 Free RLock prior to returning 2017-07-08 07:14:50 -07:00
Jason Wilder dba3ce1a42 Merge pull request #8576 from influxdata/jw-delete-index
Fix index inconsistency after deletes
2017-07-07 14:36:33 -06:00
Jason Wilder 3fac69464e Merge pull request #8577 from influxdata/jw-wal-sync-hang
Fix indefinite hang in WAL.writeToLog
2017-07-07 14:35:32 -06:00
Jason Wilder e9370e0b86 Fix indefinite hang in WAL.writeToLog
There was a race in the WAL writeToLog and scheduleSync which could
lead to a writing goroutine blocking indefinitely on its syncErr channel.

The issue was that the clearing of the syncCount happenend after the
wal was unlock.  If a goroutine was able to lock, write and call scheduleSync
before the existing scheduleSync goroutine returns and ran the defer to
clear the syncCount, then a new scheduleSync goroutine would not get started.
This left the writing goroutine block with nothing to signal it.

While in this state, a RLock on the engine was held.  If a Lock was requested
on the engine during this time, all future writes and queries would block waiting
on the blocked wal writer.

The fix is to move the atomic clearing of syncCount before the Lock is released.
2017-07-07 13:31:52 -06:00
Jason Wilder 5e11cdcdd7 Fix incorrect condition in OverlapsKeyRange
The min key was not used in OverlapsKeyRange which caused it to return
false when it should be true.  This causes a bug where deletes would not
write tombstones for files that actually contained the data it was supposed
to delete.
2017-07-07 12:19:33 -06:00
Jason Wilder 839cddf6d5 Refresh index after compactions
The in-memory index can get out of sync when deletes and writes
to the same measurement are running concurrently.  The index is
updated independently from data on disk and it's possible for the
index to unassign a shard when data still exists on disk.  What happens
is that there are TSM files on disk, but the index does not know that
the series that exist in those files still are in the shard.  Restarting
the server reloads the index and the data is visible again.  From and
end user perspective, this can look like more data is deleted than should
have been or that deleted data re-appears after a restart or writes to the
shard occur again.

There isn't an easy way to resolve this since the index and storage
are not transactional resources and we cannot atomically commit or
rollback changes to both at once.

As a workaround, after new TSM files are installed, we refresh the
index with series keys that exist in the new tsm files as well as
any lingering data still in the cache.  There is a small window of time
when the index may be missing series, but it will re-appear after the refresh
completes.
2017-07-07 12:19:30 -06: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
Adam 2259ada8c3 adds a new header key/value X-Influxdb-Build that has value OSS if called from open-source build, and ENT if called from enterprise. This commit sets the value for the OSS case, and also creates the proper flag 2017-07-07 10:59:26 -04:00