Commit Graph

417 Commits (9b8c81c49c1d40ad610424398ce5d5d26003a6be)

Author SHA1 Message Date
Ben Johnson 65f42deec4
Merge pull request #20008 from influxdata/flakey-test-field-conflict-concurrent
fix: Add locking during tsi iterator creation.
2020-11-12 13:42:38 -07:00
Ben Johnson edb5e56881 fix: Add locking during tsi iterator creation.
This commit fixes a locking issue that caused the `TestShard_WritePoints_FieldConflictConcurrent`
test to fail.
2020-11-12 06:57:29 -07:00
Daniel Moran 15b9531273
fix: correct various typos (#19987)
Co-authored-by: kumakichi <xyesan@gmail.com>
2020-11-11 13:54:21 -05:00
Mark Rushakoff 1f1f520c58 chore: remove unreferenced tsdb/index/internal package 2020-10-28 12:38:01 -04:00
sans 7dcaf5c639
fix: typos (#19734) 2020-10-13 09:50:32 -07:00
Stuart Carnie 8753a7fd08 chore: Fix invalid string casts from integers
Newer Go versions generate a compile time error
2020-09-16 11:55:20 -07:00
Ayan George ca2055c16c
refactor: Replace ctx.Done() with ctx.Err() (#19546)
* refactor: Replace ctx.Done() with ctx.Err()

Prior to this commit we checked for context cancellation with a select
block and context.Context.Done() without multiplexing over any other
channel like:

  select {
    case <-ctx.Done():
      // handle cancellation
    default:
      // fallthrough
  }

This commit replaces those type of blocks with a simple check of
ctx.Err().  This has the following benefits:

* Calling ctx.Err() is much faster than entering a select block.

* ctx.Done() allocates a channel when called for the first time.

* Testing the result of ctx.Err() is a reliable way of determininging if
  a context.Context value has been canceled.

* fix: Fix data race in execDeleteTagValueEntry()
2020-09-16 12:20:09 -04:00
Brett Buddin b917d8d9b0
chore(influxdb): Placate the linter. 2020-08-27 15:46:32 -04:00
Stuart Carnie dee8977d2c
chore: move v2/v1/tsdb → v2/tsdb 2020-08-26 10:46:47 -07:00
Mark Rushakoff f2898d1992 Wipe out workspace in preparation for v2 merge
"Knock knock."

"Who's there?"

"InfluxDB Veet."

...
2019-01-11 10:38:50 -08:00
Edd Robinson 3a055a6107 Fix cardinality estimation error
This commit fixes an error in the TSI index with estimating the
cardinality of series recently added and then removed.
2019-01-10 17:46:30 +00:00
Jeff Wendling 259f3fe6e5 tsdb: consider measurement drops per shard on inmem 2018-11-27 16:59:17 -07:00
Jeff Wendling 0a2f6191a6 tsdb: clean up fields index for every kind of delete
Before this, if you deleted everything with `delete where true`
for example, then you would be left with all of your measurements
in the fields index. That would cause ghost fields to reappear
if someone reinserted to the measurement.

This fixes that by making it so the deepest most delete code
checks if the measurement was removed from the index, and if so
cleaning it up out of the fields index.

Additionally, it fixes bugs in that cleanup code where if you had
a measurement like "m1" and "m10", when iterating over the cache
or file store, "m1" would match "m10" due to it only checking the
prefix. This also has it check the character right after the
measurement to be either a comma because tags started, or the first
character of the field separator.
2018-11-27 16:12:06 -07:00
Edd Robinson cade59e253 Fix panic in IndexSet
This commit fixes a panic where a concurrent removal of a shard and meta
query could cause a `nil` index to be added to the IndexSet`.
2018-10-26 18:23:54 +01:00
Ben Johnson bdcbad3fc9
Fix append of possible nil iterator.
This commit updates an iterator list to ignore `nil` iterators.
Adding a `nil` caused the `SeriesIterators.Close()` to panic.
2018-10-02 13:19:21 -06:00
Ben Johnson 0d777ad423
Fix tsi1 sketch locking. 2018-09-26 17:01:47 -06:00
Edd Robinson 812ac6da25 PR feedback 2018-09-18 15:58:38 -07:00
Edd Robinson a15bdeef92 Fix megacheck 2018-09-18 15:58:38 -07:00
Edd Robinson 76237d80f2 Address PR feedback 2018-09-18 15:58:38 -07:00
Ben Johnson e651153f1c Add TagValueSeriesIDCache.Delete(). 2018-09-18 15:58:38 -07:00
Ben Johnson fcbc03240a Inline mutex into TagValueSeriesIDCache. 2018-09-18 15:58:38 -07:00
Edd Robinson bdc293abdd Tidy up 2018-09-18 15:58:38 -07:00
Edd Robinson d8af622333 Add benchmark for TagSets across indexes 2018-09-18 15:58:38 -07:00
Edd Robinson 5c88a1dd0e Fix locking on cache 2018-09-18 15:58:38 -07:00
Edd Robinson 6d12f5d323 Debug 2018-09-18 15:58:38 -07:00
Edd Robinson 8af7c133db Refactor cache 2018-09-18 15:58:38 -07:00
Edd Robinson 1ae716b64e Use copy-on-write when cloning bitmaps
This commit sets the copy-on-write feature of the SeriesIDSets, such
that we can make immutable clones of underlying bitmaps efficiently. If
the original bitmap is modified then a copy will be made, which won't
affect the clone.
2018-09-18 15:58:38 -07:00
Edd Robinson baf35f2138 Add benchmarks for cache and option to disable 2018-09-18 15:58:38 -07:00
Edd Robinson 3f6ef0ba22 Update cached bitset results with new series ids
This commit ensures that cached bitset results at the Index level are
updated whenever new series ids are created that would belong in those
bitsets.

For example, if we have a cached bitset for the tuple {mem, region,
west}, and we add the series mem,host=prod,region=west then we would
update the cached bitset for {mem, region, west} with the series id of
the newly written series.
2018-09-18 15:58:38 -07:00
Edd Robinson 065d47e4f2 Return created series ids from LogFile insertion 2018-09-18 15:58:38 -07:00
Edd Robinson 52b5640a4a Add test for TagValueSeriesIDIterator 2018-09-18 15:58:38 -07:00
Edd Robinson 9fb301cf10 Add CreateSeriesListIfNotExists benchmark 2018-09-18 15:58:38 -07:00
Edd Robinson 2c4c79f110 Convert cache to LRU 2018-09-18 15:58:38 -07:00
Edd Robinson 2ae2157d02 debug 2018-09-18 15:58:38 -07:00
Edd Robinson 74b3d35e40 Basic cache 2018-09-18 15:58:38 -07:00
Edd Robinson 7d00a45ebf Don't allocate when reading tombstone SeriesID set 2018-09-18 15:58:38 -07:00
Edd Robinson ca07a38402 Add benchmark for TagValueSeriesIDIterator 2018-09-18 15:53:52 -07:00
Ben Johnson 88d006a18c
Remove TSI1 HLL sketches from heap.
This commit removes the HLL sketches on each `tsi1.LogFile` and
`tsi1.IndexFile` and instead caches the data at the `tsi1.Index`
level. This reduces the heap size significantly for servers with
many TSI-enabled shards.
2018-09-12 08:48:40 -06:00
Stuart Carnie 4e91c8d33d Revert: Unmap LogFile on successful open
Resolves a panic when attempting to sort the `logMeasurements` slice,
which holds on to mmap'd data.
2018-09-04 15:16:09 -06:00
Edd Robinson 9970620ee0 Unmap LogFile on successful open
Since we append to the file itself, once we have read the file in, we
can be done with the mmap'd data.

Ideally we can rework UnmarshalBinary and do away with the mmap
completely. That is future work.
2018-08-23 17:24:22 +01:00
Edd Robinson dece5b847f Refactor index names 2018-08-21 14:32:30 +01:00
Edd Robinson a67f15fad4 Promote DropSeriesGlobal to Index interface 2018-08-20 17:57:16 +01:00
Edd Robinson 035b26cadd Refactor DropSeriesGlobal 2018-08-20 16:37:55 +01:00
Edd Robinson 19a4f1c9b0 Fix megacheck 2018-07-31 15:22:54 +01:00
Edd Robinson 61af08abde Fix megacheck 2018-07-31 15:03:54 +01:00
Ben Johnson 5612511a8f
Use roaring.Bitmap.FromBuffer(), remove memory alignment. 2018-07-30 13:42:13 +00:00
Ben Johnson 66920a181a
Add legacy tsi1 uvarint encoding test. 2018-07-27 15:43:14 +01:00
Ben Johnson 80d01325f8
Refactor file set tag value iterators to support series sets & tombstones. 2018-07-26 23:48:27 +01:00
Ben Johnson cb828f0187
Fix roaring dependency, minor PR fixes. 2018-07-26 09:32:43 +01:00
Ben Johnson fdfd038401
Add roaring bitmaps to TSI index files. 2018-07-24 17:59:23 +01:00