Commit Graph

161 Commits (815f740f4c4f4253dffd0a18471eb9ba02f39c0a)

Author SHA1 Message Date
Stuart Carnie c89d98dc02 gofmt 2017-05-25 16:00:23 -07:00
Stuart Carnie 386720b2e7 improvements to inmem/Measurement.TagSets API
```
benchmark                                             old ns/op     new ns/op     delta
BenchmarkMeasurement_TagSetsNoDimensions_1000-8       234054        117315        -49.88%
BenchmarkMeasurement_TagSetsDimensions_1000-8         996838        313313        -68.57%
BenchmarkMeasurement_TagSetsNoDimensions_100000-8     58940464      39452117      -33.06%
BenchmarkMeasurement_TagSetsDimensions_100000-8       175612060     70195562      -60.03%

benchmark                                             old allocs     new allocs     delta
BenchmarkMeasurement_TagSetsNoDimensions_1000-8       1026           26             -97.47%
BenchmarkMeasurement_TagSetsDimensions_1000-8         8026           2029           -74.72%
BenchmarkMeasurement_TagSetsNoDimensions_100000-8     100064         64             -99.94%
BenchmarkMeasurement_TagSetsDimensions_100000-8       800064         200067         -74.99%

benchmark                                             old bytes     new bytes     delta
BenchmarkMeasurement_TagSetsNoDimensions_1000-8       117080        69080         -41.00%
BenchmarkMeasurement_TagSetsDimensions_1000-8         549081        117176        -78.66%
BenchmarkMeasurement_TagSetsNoDimensions_100000-8     23298264      18498265      -20.60%
BenchmarkMeasurement_TagSetsDimensions_100000-8       66498276      23298360      -64.96%
```
2017-05-25 15:52:27 -07:00
Stuart Carnie 5c5bea2baa move Measurement and Series to inmem package 2017-05-19 08:17:09 -07:00
Jason Wilder 2cac46ebbc Convert usage of strings to []byte
Measurement name and field were converted between []byte and string
repetively causing lots of garbage.  This switches the code to use
[]byte in the write path.
2017-05-12 14:05:19 -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 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
Jason Wilder 883b3dcbbb Reduce lock content in AssignShard
The lock shows up under write load.  It only needs to be assigned
once so a read lock eliminates the contention.
2017-04-18 16:32:33 -06:00
Jason Wilder cf100647e0 Fix deadlock in Measurement.SeriesIDsAllOrByExpr
SeriesIDsAllOrByExpr took a RLock and ended up calling SeriesIDs
which can take a Lock causing a deadlock.
2017-04-05 16:22:45 -06:00
Ben Johnson 9c97cd8601
Merge remote-tracking branch 'upstream/master' into tsi 2017-04-04 12:46:09 -06:00
Jason Wilder 5fa8073fc2 Merge branch '1.2' into jw-merge-123 2017-04-04 11:12:06 -06:00
Jason Wilder fcdc3c5c21 Remove commented out code in meta 2017-04-03 11:22:59 -06:00
Jason Wilder 8da84e6144 Merge branch 'master' into tsi 2017-04-03 11:21:02 -06:00
Jason Wilder 68f73e64d1 Lazily sort Measurement.SeriesIDs
Removing series while trying to maintain the sorted series list
does not perform well when removing many series.  This causes
drop DB, RP, series, to be very slow in some cases.

Instead, lazily create a sorted series list when first requested and
invalidate it when dropping series.
2017-04-03 08:57:53 -06:00
Edd Robinson fddaff2cc8 Merge master in 2017-03-29 18:00:28 +01:00
Jason Wilder 2972a3f223 Remove MMAP derefencing code
This code was added to address some slow startup issues.  It is believed
to be the cause of some segfault panic's that occur at query time when
the underlying MMAP array has been unmapped.  The current structure of
code makes this change unnecessary now.
2017-03-23 12:46:23 -06:00
Edd Robinson 47448646ed Remove DropSeries on index 2017-03-21 11:35:31 +00:00
Jason Wilder 8177df2dab Simplify Measurement.TagSets signature 2017-03-17 16:19:10 -06:00
Jason Wilder 2d5d899ac2 Allow queries to be interrupted during planning
If a bad query is run, kill query and limits would not kick in until
after it started executing.  Some bad queries that involve high
cardinality can cause the server to OOM just from planning which
defeats the purpose of the max-select-series limit.

This change primarily fixes max-select-series limit so that the query
is killed earlier and has the side effect that kill query now can kill
a query while it's being planned.
2017-03-17 16:00:54 -06:00
Jason Wilder bc4aeefbed Check max-series-limit in shard iterator creation
The limit waited until all the iterators had been created which still
allows problem queries to be planned.  This allows the queries to be
aborted much earlier in some cases.
2017-03-17 16:00:25 -06:00
Ben Johnson 358b1e0b05
Merge remote-tracking branch 'upstream/master' into tsi 2017-03-15 10:13:32 -06:00
Jason Wilder a024003f2c Merge branch '1.2' into jw-merge-12 2017-02-22 12:13:29 -07:00
Ben Johnson 78a9bb2527 Remove Tags.shouldCopy, replace with forceCopy on series creation.
Previously, tags had a `shouldCopy` flag to indicate if those tags
referenced an underlying buffer and should be copied to allow GC.
Unfortunately, this prevented tags from being copied that were
created and referenced the mmap which caused segfaults.

This change removes the `shouldCopy` flag and replaces it with a
`forceCopy` argument in `CreateSeriesIfNotExists()`. This allows
the write path to indicate that tags must be cloned on insert.
2017-02-21 11:13:35 -07:00
Mark Rushakoff 601cbcd084 Merge branch '1.2' into mr-merge-12 2017-02-17 16:14:22 -08:00
Ben Johnson 8e79ca5d75
Fix tag dereferencing panic.
Clones series tags under lock during var ref iterator creation.
2017-02-15 17:56:47 -07:00
Jason Wilder 2e95b4043c Merge branch '1.2' into jw-merge-12 2017-02-02 16:40:36 -07:00
Ben Johnson faef0a99c9
Perform series tag iteration under lock.
Adds a `tsdb.Series.ForEachTag()` function for safely iterating
over a series' tags within the context of a lock. This preverts
tags from being dereferenced during iteration which can cause
a seg fault.
2017-02-01 16:25:53 -07:00
Edd Robinson 91ee34b111 Merge pull request #7837 from influxdata/er-tidy
General tidy up and subtle bug fixes
2017-01-26 13:43:07 +00:00
Ben Johnson 047c21f4d9
Merge remote-tracking branch 'upstream/master' into tsi 2017-01-24 09:28:58 -07:00
Gunnar 3722fa383d Merge pull request #7718 from influxdata/ga-drop-stats
Add stats on dropped measurements and series; Fixes #7697
2017-01-20 15:54:06 -08:00
Edd Robinson 292b30b82b Fix subtle bugs and remove dead code from tsdb 2017-01-17 09:47:34 -08:00
Edd Robinson 320c5981cb Fixes racy locking on measurement 2017-01-17 09:44:56 -08:00
Edd Robinson 45324b3848 Fixes racy locking on measurement 2017-01-16 14:22:11 -08:00
Joe LeGasse cd00085e9e Adjust Tags cloning
This change delays Tag cloning until a new series is found, and will
only clone Tags acquired from `ParsePoints...` and not those referencing
the mmap-ed files (TSM) that are created on startup.
2017-01-13 13:15:36 -05:00
Mark Rushakoff a135906b43 Merge pull request #7747 from influxdata/mr-lint-cleanup
Miscellaneous lint cleanup
2017-01-10 08:22:00 -08:00
Ben Johnson f9efcb3365
Re-add shared in-memory index. 2017-01-05 10:17:09 -07:00
Ben Johnson 183418dcbd
Fix tsi TAG KEYS iterator. 2017-01-05 10:15:36 -07:00
Ben Johnson 9f8b206b51
Fix measurement system queries. 2017-01-05 10:15:34 -07:00
Ben Johnson 4aa78383d1
Fix tsi1 series deletion. 2017-01-05 10:14:48 -07:00
Ben Johnson cb93f10120
Remove per-shard in-memory index. 2017-01-05 10:11:09 -07:00
Ben Johnson 409b0165f5
shared in-memory index 2017-01-05 10:09:57 -07:00
Ben Johnson a812502ea3
reintegrating in-memory index 2017-01-05 10:07:35 -07:00
Ben Johnson 1ac067e53b
intermediate 2017-01-05 10:03:09 -07:00
Ben Johnson 62d2b3ebe9
Series filtering. 2017-01-05 10:02:42 -07:00
Ben Johnson 62269c3cea
intermediate 2017-01-05 10:02:41 -07:00
Ben Johnson 5f5b02e052
intermediate 2017-01-05 10:01:49 -07:00
Ben Johnson afce53e81b
Rebase fixes. 2017-01-05 10:00:44 -07:00
Ben Johnson 2a81351992
Implement tsdb.Index interface on tsi1.Index. 2017-01-05 10:00:43 -07:00
Edd Robinson e2c3b52ca4
Adds a custom HyperLogLog++ implementation 2017-01-05 10:00:14 -07:00
Edd Robinson 2d9bd09784
Use []byte where possible in Index 2017-01-05 09:57:34 -07:00
Edd Robinson 4b1ef68dc9
Move series and measurement stats to store 2017-01-05 09:54:05 -07:00