Commit Graph

12082 Commits (aa762b96df3a5868ef4c3230696bc0f0aed3c981)

Author SHA1 Message Date
Jason Wilder b150a6293c Merge pull request #8380 from influxdata/jw-wal-buffer
Use buffer writer for wal segments
2017-05-11 08:34:44 -06:00
Jason Wilder 76428d168c Merge pull request #8373 from sebito91/influx_inspect_sort_tags
sort influx_inspect detailed report results
2017-05-10 12:24:49 -06:00
Jason Wilder b81ac21bcb Merge pull request #8378 from influxdata/jw-snapshot-disable
Don't disable snapshots when snapshot compactions are disabled
2017-05-10 12:00:27 -06:00
Jason Wilder e102fcca9c Use buffer writer for wal segments 2017-05-10 11:42:32 -06:00
Jason Wilder 39a829c1ae Speed up time encoding/decoding
This speeds up time encoding and decoding by skipping the divisor
scaling if scaling by 1.  Since division and multiplication are expensive
cpu and scaling by 1 has no effect, this just slows encoding and decoding
down.
2017-05-10 11:12:35 -06:00
Jason Wilder 4e3e707abc Fix packed time encoded benchmark 2017-05-10 10:35:44 -06:00
Jonathan A. Sternberg 75530bd0b0 Merge pull request #8376 from influxdata/js-8358-etc-config-sample
Small edits to the etc/config.sample.toml file
2017-05-10 11:29:48 -05:00
Jonathan A. Sternberg dea02009e0 Small edits to the etc/config.sample.toml file 2017-05-10 10:56:34 -05:00
Jonathan A. Sternberg 38735b24f6 Merge pull request #8350 from influxdata/js-request-tracker
Track HTTP client requests for /write and /query with /debug/requests
2017-05-09 13:52:58 -05:00
Jonathan A. Sternberg 2780630a5f Track HTTP client requests for /write and /query with /debug/requests
After using `/debug/requests`, the client will wait for 30 seconds
(configurable by specifying `seconds=` in the query parameters) and the
HTTP handler will track every incoming query and write to the system.
After that time period has passed, it will output a JSON blob that looks
very similar to `/debug/vars` that shows every IP address and user
account (if authentication is used) that connected to the host during
that time.

In the future, we can add more metrics to track. This is an initial
start to aid with debugging machines that connect too often by looking
at a sample of time (like `/debug/pprof`).
2017-05-09 10:18:33 -05:00
Sebastian Borza 6bb85f809a
sort influx_inspect detailed report results 2017-05-08 23:30:40 -05:00
Jason Wilder e6f31c38b5 Merge pull request #8372 from influxdata/jw-tombstone-range
Fix deletes triggering unnecessary compactions
2017-05-08 16:52:59 -06:00
Jason Wilder a9920cd6a9 Merge pull request #8370 from influxdata/jw-races
Fixes races/memory usage
2017-05-08 15:13:11 -06:00
Jason Wilder 29c2b1958e Fix deletes triggering unnecessary compactions
Tombstone files would be written to all TSM files even if the deleted
keys or timerange did not exist in the TSM file.  This had the side
effect of causing shards to get recompacted back to the same state. If
any shards or large numbers of TSM files existed, disk usage and CPU
utilization would spike causing issues.

This prevents tombstones being written for TSM files that could not
possiby contain the series keys being deleted or if the delted time
range is outside the range of the file.
2017-05-08 14:52:28 -06:00
Jonathan A. Sternberg 4df54aa86b Merge pull request #8357 from rw-influxdata/2017-05--fix-panic-in-AST-rewriter
Fix panic in AST rewriter when (*SelectStatement).Condition == nil
2017-05-08 15:21:29 -05:00
Jason Wilder 9374c4f513 Reduce allocations when monitoring shards
When monitoring shards, a slice of measurements is allocated for
each shard.  With many shards and measurements, these allocations
can be large.  Since inmem shards share the same index, we only
need to do this once since the resulting slices are all the same.
This reduces memory usage when monitoring shard cardinality.
2017-05-08 13:34:40 -06:00
Jason Wilder 00bdf62b83 Make shard is ready before returning index type
Shard can be created before they are opened and not have an index
setup yet.  This can cause a panic if IndexType is called.
2017-05-08 12:48:35 -06:00
Jason Wilder 041262af0e Fix race in shard
engine was accessed outside of an RLock which can cause a race when
montitoring goroutines access the shard while it's closed/closing.
2017-05-08 12:37:18 -06:00
Ben Johnson ef6b0e214b Merge pull request #8366 from benbjohnson/tsi-inspect
Add TSI support tooling.
2017-05-08 11:01:17 -06:00
Ben Johnson 489c89bea4
Add tsi support tooling. 2017-05-08 11:00:15 -06:00
Jason Wilder c0c6ad6880 Don't disable snapshots when snapshot compactions are disabled
Snapshot compactions can be disabled independently of snapshotting
capability.  This prevents taking backups of shards that have compactions
disabled.
2017-05-05 14:15:45 -06:00
Jonathan A. Sternberg a4a902e3f2 Merge pull request #8344 from influxdata/js-8343-csv-output-null-values
Set the CSV output to an empty string for null values
2017-05-05 10:01:55 -05:00
Jonathan A. Sternberg 260bdef3d4 Set the CSV output to an empty string for null values 2017-05-04 20:51:58 -05:00
Jason Wilder 0b018caf87 Merge pull request #8359 from influxdata/jw-index-race
Fix race in SeriesN and CreateSeriesIfNotExists
2017-05-04 17:49:14 -06:00
rw-influxdata 67279ccc64 Fix AST rewriting panic due to a nil Condition. 2017-05-04 14:51:53 -07:00
Jason Wilder 73ddd4787b Fix race in SeriesN and CreateSeriesIfNotExists 2017-05-04 14:40:50 -06:00
Jason Wilder 23af70add4 Merge pull request #8348 from influxdata/jw-tsm-compaction-limit
Compaction limits
2017-05-04 11:08:11 -06:00
Jason Wilder fc34d30038 Uses SeriesN instead of copying sketches
Avoids some extra allocations.
2017-05-04 10:12:38 -06:00
Jason Wilder bc639c5982 Make disableLevelCompactions lighter weight
Since this is called more frequently now, the cleanup func was invoked
quite a bit which makes several syscalls per shard.  This should only
be called the first time compactions are disabled.
2017-05-04 09:56:15 -06:00
Jason Wilder 7371f1067b Fix deadlock in Index.ForEachMeasurementTagKey
Index.ForEachMeasurementTagKey held an RLock while call the fn,
if the fn made another call into the index which acquired an RLock
and after another goroutine tried to acquire a Lock, it would deadlock.
2017-05-03 22:48:10 -06:00
Jason Wilder b4ea523910 Include snapshot size in the total cache size
This was causing a shard to appear idle when in fact a snapshot compaction
was running.  If the time was write, the compactions would be disabled and
the snapshot compaction would be aborted.
2017-05-03 16:31:58 -06:00
Jason Wilder 88848a9426 Remove per shard monitor goroutine
The monitor goroutine ran for each shard and updated disk stats
as well as logged cardinality warnings.  This goroutine has been
removed by making the disks stats more lightweight and callable
direclty from Statisics and move the logging to the tsdb.Store.  The
latter allows one goroutine to handle all shards.
2017-05-03 16:31:57 -06:00
Jason Wilder 684f5d884a Update changelog 2017-05-03 16:31:57 -06:00
Jason Wilder f87fd7c7ed Stop background compaction goroutines when shard is cold
Each shard has a number of goroutines for compacting different levels
of TSM files.  When a shard goes cold and is fully compacted, these
goroutines are still running.

This change will stop background shard goroutines when the shard goes
cold and start them back up if new writes arrive.
2017-05-03 16:31:57 -06:00
Jason Wilder 3d1c0cd981 Don't return compaction plans for files already part of a plan
The compactor prevents the same file from being compacted by different
compaction runs, but it can result in warning errors in the logs that
are confusing.

This adds compaction plan tracking to the planner so that files are
only part of one plan at a given time.
2017-05-03 16:31:57 -06:00
Jason Wilder 8fc9853ed8 Add max-concurrent-compactions limit
This limit allows the number of concurrent level and full compactions
to be throttled.  Snapshot compactions are not affected by this limit
as then need to run continously.

This limit can be used to control how much CPU is consumed by compactions.
The default is to limit to the number of CPU available.
2017-05-03 16:31:57 -06:00
Jason Wilder 80fef4af4a Enable shards after loading
Compactions are enabled as soon as the shard is opened.  This can
slow down startup or cause the system to spike in CPU usage at startup
if many shards need to be compacted.

This now delays compactions until after they are loaded.
2017-05-03 16:31:57 -06:00
Jason Wilder 72df1fe4d9 Merge pull request #8355 from influxdata/jw-measurement-deadlock
Fix deadlock in Measurement
2017-05-03 15:01:44 -06:00
Jason Wilder 02e22f4a00 Fix deadlock in Measurement
The lazy sorting of series caused a deadlock since it can not take
a Lock when a caller may have already acquired an RLock.

filters should be called w/o any locks as the function already acquires
locks as needed.
2017-05-03 13:49:56 -06:00
Jonathan A. Sternberg 9bd7fcea32 Merge pull request #8081 from influxdata/js-8045-subqueries-with-conditions
Refactor the subquery code and fix outer condition queries
2017-05-01 17:10:58 -05:00
Jonathan A. Sternberg df30a4d9c9 Refactor the subquery code and fix outer condition queries
This change refactors the subquery code into a separate builder class to
help allow for more reuse and make the functions smaller and easier to
read.

The previous function that handled most of the code was too big and
impossible to reason through.

This also goes and replaces the complicated logic of aggregates that had
a subquery source with the simpler IteratorMapper. I think the overhead
from the IteratorMapper will be more, but I also believe that the actual
code is simpler and more robust to produce more accurate answers. It
might be a future project to optimize that section of code, but I don't
have any actual numbers for the efficiency of one method and I believe
accuracy and code clarity may be more important at the moment since I am
otherwise incapable of reading my own code.
2017-04-28 17:12:32 -05:00
Jonathan A. Sternberg 8655042b12 Merge pull request #8261 from influxdata/js-8066-sample-with-limit-and-offset
Fix LIMIT and OFFSET for certain aggregate queries
2017-04-28 17:07:40 -05:00
Jason Wilder 9045b674e8 Merge pull request #8337 from influxdata/jw-shard-diff
Add TSM import capabilities
2017-04-28 14:59:01 -06:00
Jonathan A. Sternberg addc12561f Fix LIMIT and OFFSET for certain aggregate queries
When LIMIT and OFFSET were used with any functions that were not handled
directly by the query engine (anything other than count, max, min, mean,
first, or last), the input to the function would be limited instead of
receiving the full stream of values it was supposed to receive.

This also fixes a bug that caused the server to hang when LIMIT and
OFFSET were used with a selector. When using a selector, the limit and
offset should be handled before the points go to the auxiliary iterator
to be split into different iterators. Limiting happened afterwards which
caused the auxiliary iterator to hang forever.
2017-04-28 15:55:06 -05:00
Jason Wilder 3c130cd39c Expose TSMWriter.Flush
Allows flushing the writer so we don't always need to close and
re-open the file handle.
2017-04-28 14:00:50 -06:00
Jason Wilder 141f0d71cd Update index when import files 2017-04-28 14:00:45 -06:00
Jason Wilder ca85dd4cff Merge pull request #8324 from influxdata/rkuchan-patch-1
Update CONTRIBUTING with InfluxData Community link
2017-04-28 13:40:09 -06:00
Jason Wilder a76146e34a Add Store.Import capability
This allows the contents of a backup to be imported into a shard without
requiring the whole shard to be replaced.
2017-04-28 13:30:46 -06:00
Jason Wilder 3839fe34ea Remove FileStore.Add/Remove
Can use Replace which handles files in-use and stats correctly.
2017-04-28 13:20:55 -06:00
Jason Wilder 137d0c0d09 Rename WAL.WritePoints to WAL.WriteMulti
To match Cache.WriteMulti
2017-04-28 13:20:55 -06:00