Commit Graph

10505 Commits (48692a1f139d78a687f3fdd007f82301cf719c51)

Author SHA1 Message Date
Jonathan A. Sternberg 48692a1f13 Merge pull request #6809 from influxdata/js-kill-query-on-specific-host
Add option to KILL QUERY to kill on a specific host
2016-06-10 12:33:03 -05:00
Jonathan A. Sternberg c8e90fa4ee Merge pull request #6640 from influxdata/js-5655-graphite-retention-policy
Support specifying a retention policy for the graphite service
2016-06-09 11:57:07 -05:00
Jonathan A. Sternberg 4f37bc5a40 Support specifying a retention policy for the graphite service
The graphite service will attempt to create the retention policy and use
it. If the retention policy doesn't exist, it will be created with the
default options.

Fixes #5655.
2016-06-08 17:01:44 -05:00
Jason Wilder 256f57a4f4 Merge pull request #6808 from influxdata/jw-restore-error
Ensure restore doesn't write broken files
2016-06-07 22:02:57 -06:00
Jason Wilder 17c8912f18 Merge pull request #6807 from influxdata/jw-drop-statements
Drop data before updating meta store
2016-06-07 22:02:41 -06:00
joelegasse 09eef86e92 Merge pull request #6810 from influxdata/jl-truncate-sg
Add TruncatedAt field to meta.ShardGroupInfo
2016-06-07 18:52:06 -04:00
Joe LeGasse 647210c57a Add TruncatedAt field to meta.ShardGroupInfo 2016-06-07 18:24:24 -04:00
Jonathan A. Sternberg 2fa6d306c2 Add option to KILL QUERY to kill on a specific host
Option only applies to clustering.
2016-06-07 16:48:07 -05:00
Jason Wilder ac6addd0b5 Ensure restore doesn't write broken files
Restore would try to open the shard if there was an error.  If there
was an error, the files written are very likely to be partially written
and they can cause the server to panic.

To prevent a shard from trying to open broken files, we now write to
a temp file and rename it to the actual name only after fully writing
and fsyncing the file.
2016-06-07 14:36:46 -06:00
Jason Wilder f9379eddf2 Drop data before updating meta store
If a drop statement failed to remove state on disk, the meta store
would still be updated and you would not be able to retry the delete
leaving orphaned data around.

This reverses the logic so the data must be removed before the meta
store is updated.
2016-06-07 12:14:04 -06:00
Jonathan A. Sternberg 022479778d Merge pull request #6803 from influxdata/js-remove-database-index-from-tsdb-store-interface
Remove the DatabaseIndex method from TSDBStore interface
2016-06-07 11:54:00 -05:00
Jonathan A. Sternberg fe3f0d0e3d Remove the DatabaseIndex method from TSDBStore interface
The TSDBStore interface needs to also allow for remote TSDBStore but the
DatabaseIndex is only for a local TSDB instance. Moved the optimized
SHOW TAG VALUES path to do a typecast to the LocalTSDBStore struct
instead of always attempting to use the optimized version.

If the TSDBStore is not local and does not have the DatabaseIndex, it
will default to using the distributed query instead.
2016-06-07 11:34:34 -05:00
Jonathan A. Sternberg b972c220aa Merge pull request #6757 from influxdata/js-refactor-execute-query
Refactor ExecuteQuery to take options as a struct
2016-06-07 10:35:52 -05:00
Paul Dix 6fa52441de Update CHANGELOG.md 2016-06-07 07:24:24 -07:00
Jonathan A. Sternberg 1e562408f1 Merge pull request #6779 from joe2far/patch-1
Fixed typo in docstring
2016-06-07 08:26:23 -05:00
Ben Johnson bf3c22689b Merge pull request #6792 from benbjohnson/show-tag-values
Optimize SHOW TAG VALUES
2016-06-06 16:00:12 -06:00
Jason Wilder 9c0c2f9ebe Merge pull request #6794 from influxdata/jw-cache
Cache safety fixes
2016-06-06 15:59:47 -06:00
Ben Johnson 1b94cd2686
optimize SHOW TAG VALUES
This commit optimizes `SHOW TAG VALUES` so that it avoids the
`SELECT` query engine execution and iterator creation. There
are also optimizations to reduce individual memory allocations
and to reduce in-memory heap size by only operating on one
measurement at a time.

Execution time has been reduce to approximately 900ms for
500,000 rows. This is about 2µs per row. Of this time,
approximately 1µs is spent retrieving and sorting the row
and 1µs is spent encoding into JSON and writing to the
response body.
2016-06-06 15:50:53 -06:00
Jason Wilder 838a29cca8 Fix race in cache
If cache.Deduplicate is called while writes are in-flight on the cache, a data race
could occur.

WARNING: DATA RACE
Write by goroutine 15:
  runtime.mapassign1()
      /usr/local/go/src/runtime/hashmap.go:429 +0x0
  github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Cache).entry()
      /Users/jason/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/cache.go:482 +0x27e
  github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Cache).WriteMulti()
      /Users/jason/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/cache.go:207 +0x3b2
  github.com/influxdata/influxdb/tsdb/engine/tsm1.TestCache_Deduplicate_Concurrent.func1()
      /Users/jason/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/cache_test.go:421 +0x73

Previous read by goroutine 16:
  runtime.mapiterinit()
      /usr/local/go/src/runtime/hashmap.go:607 +0x0
  github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Cache).Deduplicate()
      /Users/jason/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/cache.go:272 +0x7c
  github.com/influxdata/influxdb/tsdb/engine/tsm1.TestCache_Deduplicate_Concurrent.func2()
      /Users/jason/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/cache_test.go:429 +0x69

Goroutine 15 (running) created at:
  github.com/influxdata/influxdb/tsdb/engine/tsm1.TestCache_Deduplicate_Concurrent()
      /Users/jason/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/cache_test.go:423 +0x3f2
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:473 +0xdc

Goroutine 16 (finished) created at:
  github.com/influxdata/influxdb/tsdb/engine/tsm1.TestCache_Deduplicate_Concurrent()
      /Users/jason/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/cache_test.go:431 +0x43b
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:473 +0xdc
2016-06-06 15:45:01 -06:00
Jason Wilder bc76048371 Fix panic in cache.DeleteRange
Deleting keys that did not exist in the cache could cause a panic
because the entry returned would be nil and was not checked.
2016-06-06 14:48:53 -06:00
Jonathan A. Sternberg b8e22d9d79 Merge pull request #6586 from influxdata/js-3733-rename-default-retention-policy
Modify the default retention policy name and make it configurable
2016-06-06 15:05:29 -05:00
Jason Wilder a27f2a3cb0 Merge pull request #6769 from rubycut/auth_panic
lock auth properly
2016-06-06 12:21:37 -06:00
Jonathan A. Sternberg 7da0638a84 Merge pull request #6784 from influxdata/js-server-reporting-proper-exit
Perform a proper exit for the reportServer goroutine
2016-06-06 10:03:43 -05:00
Jonathan A. Sternberg 5b26780ead Perform a proper exit for the reportServer goroutine
Previously, the goroutine would block for 24 hours and would only check
every 24 hours if the server was closed. Since this never happened, the
goroutine would just be abruptly killed when the main process ended
(since nobody waited for this goroutine to end).

Updating the code to exit when the server is closed immediately and
switching the timer to a ticker instance that can be stopped.
2016-06-05 10:45:19 -05:00
Rubycut a849f42cc2 Lock auth properly, code suggested by @jwilder 2016-06-04 09:05:10 +02:00
Jonathan A. Sternberg 573d7ed4e4 Merge pull request #6776 from influxdata/js-6756-x-influxdb-version-header
Set X-Influxdb-Version header on every request (even 404 requests)
2016-06-03 15:44:52 -05:00
Nathaniel Cook 128b07e352 Merge pull request #6764 from influxdata/nc-holt-winters-nans
Check for NaNs from Holt-Winters and do not return them
2016-06-03 11:17:11 -06:00
Joe Farrell bb8b08e2ca Fixed typo in docstring 2016-06-03 18:01:04 +01:00
Nathaniel Cook 01aa9073b6 check for NaNs and do not return them 2016-06-03 10:51:46 -06:00
Ben Johnson 443baf822c Merge pull request #6778 from benbjohnson/iterators-merge
Add Iterators.Merge()
2016-06-03 10:46:48 -06:00
Ben Johnson 3fa5cefa32
add Iterators.Merge() 2016-06-03 10:27:17 -06:00
Jonathan A. Sternberg 5c7bcda82c Set X-Influxdb-Version header on every request (even 404 requests)
Fixes #6756.
2016-06-03 10:29:50 -05:00
Jonathan A. Sternberg 7729e10a8f Merge pull request #6765 from influxdata/js-6233-show-tag-values-performance
Update SHOW TAG VALUES to use a fast dedupe iterator
2016-06-02 22:32:44 -05:00
Jonathan A. Sternberg 1e84b22407 Update SHOW TAG VALUES to use a fast dedupe iterator
Include a benchmark test for the fast dedupe iterator.
2016-06-02 22:03:59 -05:00
Nathaniel Cook 6e0c5698c1 Merge pull request #6766 from influxdata/nc-count-zero
Count and Sum return 0 for empty intervals
2016-06-02 08:45:08 -06:00
Jason Wilder cd336095ca Merge pull request #6768 from influxdata/jw-disable-open
Allow creating shards in a disabled state
2016-06-02 08:34:51 -06:00
Jason Wilder ee4267bd05 Merge pull request #6767 from influxdata/jw-unlock
Fix sporadic write failures with influx_stress
2016-06-01 19:25:48 -06:00
Jason Wilder 579923d95f Fix sporadic write failures with influx_stress
This Unlock was moved which seems to create a deadlock situation
sometimes under high write load.  This deadlock causes writes to
fail with timeouts.
2016-06-01 17:25:47 -06:00
Jason Wilder a74ea4cbf4 Allow creating shards in a disable state
For restoring a shard, we need to be able to have the shard open,
but disabled.  It was racy to open it and then disable it separately
since writes/queries could occur in between that time.
2016-06-01 16:17:18 -06:00
Nathaniel Cook ce74fe0b06 count and sum return 0 for empty intervals 2016-06-01 15:53:23 -06:00
Jonathan A. Sternberg 71c8e9e567 Refactor ExecuteQuery to take options as a struct
This allows us to add additional options to ExecuteQuery without
creating parameter bloat.

Removing the unused Series structs. Their necessity was removed by a
previous commit, but the structs were not removed yet.

Add another type of interrupt iterator that monitors the interrupt
channel and calls `Close()` on the iterator when the interrupt happens.
It will primarily be used for asynchronously closing the ReaderIterator,
but it will only close the read side of the connection properly. More
work needs to be done to allow closing the write side efficiently.
2016-06-01 12:30:52 -05:00
David Norton 1f390ee290 Merge pull request #6732 from influxdata/dn-batch-cq-writes2
batch SELECT INTO writes
2016-06-01 13:24:24 -04:00
Edd Robinson ae9a57094e Merge pull request #6763 from influxdata/er-monitor-dl
Fix deadlock in monitor
2016-06-01 18:09:54 +01:00
Edd Robinson 774e398612 Fix deadlock in monitor 2016-06-01 17:46:01 +01:00
David Norton 62f3b4486a batch SELECT INTO writes 2016-06-01 12:05:23 -04:00
Jason Wilder 05ec9599b7 Merge pull request #6744 from influxdata/jw-shard-enabled
Add ability to disable shards
2016-05-31 11:05:05 -06:00
Jason Wilder d0023dee5d Convert inline errors to constants 2016-05-31 10:51:54 -06:00
Jason Wilder 1ff8ecf4fb Add ability to disable shards
Disabling a shard causes all writes and queries to a shard to return
an error.  This also disables compactions for the shard.
2016-05-31 10:51:54 -06:00
Edd Robinson baf5d505e6 Merge pull request #6754 from influxdata/er-fs
Prevent ReadFloatBlock from panicking when no values
2016-05-31 16:41:29 +01:00
Edd Robinson 003c30989a Check for no values 2016-05-31 16:28:17 +01:00