Commit Graph

22 Commits (144aca1f7fd1cacee78ab324b639cd55246b1af2)

Author SHA1 Message Date
Edd Robinson 301ab71ba0 Remove copy-on-write when caching bitmaps
In the case of caching TSI bitmaps belonging to immutable .tsi files,
the underlying bitset data can be mmapped. It is possible, though rare,
for this data to be unmapped (e.g., via a TSI compaction) but for the
cached bitmap to be subsequently read. This leads to a segfault.

This only happens when copy-on-write is set to true on the roaring
bitmap, because in that case only the internal pointers are cloned.

This change will reduce the TSI cache performance by around 10%, which I
have deemed to account for only a few microseconds typically.
2019-01-25 18:02:48 +00: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 81f640e9ae Add more methods and benchmarks to SeriesIDSet 2018-09-18 15:58:38 -07:00
Edd Robinson 722ca22c79 Switch to influxdata fork 2018-09-18 15:58:38 -07:00
Edd Robinson 7662249fb9 Revert to RoaringBitmap org 2018-07-31 15:17:03 +01:00
Ben Johnson 5612511a8f
Use roaring.Bitmap.FromBuffer(), remove memory alignment. 2018-07-30 13:42:13 +00: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
Edd Robinson 96ed566e6c Store series ID sets in LogFile as bitmaps
This commit swaps out map[uint64]struct{} implementations for roaring
bitmaps, which in turn improves memory usage and read performance.

The bitmap implementation is abstracted such that for low cardinality
sets a simple slice of ids is used, to reduce in-use memory.
2018-07-09 11:51:48 +01:00
Ben Johnson 979d790154
Implement bitset iterator 2018-07-05 09:01:22 -06:00
Jacob Marble 2dc2b97fb9
tsdb/index: Add Bytes() methods (#9794) 2018-05-04 08:47:05 -07:00
Edd Robinson 4ccb6ada69 Remove unused code/cleanup tsdb package 2018-01-20 14:06:15 +00:00
Jason Wilder 02da1d6dfa Remove defer for SeriesIDSet.Contains
This showed up in profiles deleting high cardinality.
2018-01-16 20:46:45 -07:00
Edd Robinson ceb3abd118 Remove series when shard rolls over
Series should only be removed from the series file when they're no
longer present in any shard. This commit ensures that during a shard
rollover, the series local to the shard are checked against all other
series in the database.

Series that are no longer present in any other shards' bitsets, are then
marked as deleted in the series file.
2018-01-16 15:58:20 +00:00
Edd Robinson 338f284bc9 Simplify series set Merge logic 2018-01-16 14:56:54 +00:00
Ben Johnson 9a15130a4c Persist TSI tombstones. 2018-01-15 12:00:30 +00:00
Edd Robinson a4bef3a4bc Refactoring delete tests 2018-01-15 12:00:30 +00:00
Jason Wilder ba9a5af7eb Mark series deleted in series file
This commit adds the ability to correctly mark a series as deleted in
the global series file. Whenever a shard engine determines that a series
should be deleted, it checks with each shard's bitset for series that
are to be deleted and are no longer contained in any shard-local
bitsets.

These series are then removed from the series file.
2018-01-15 12:00:30 +00:00
Edd Robinson e2262d3e8e Implement series id tracking in TSI index 2018-01-11 01:01:54 +00:00
Edd Robinson e610e7c21d Track undeleted series IDs per-shard with inmem
This commit adds a bitset into each shard's in-memory index, to be used to
track undeleted series ids. Currently tsi1 support is not implemented.

When new series are added to the shard, the series id is added
to the bitset. When series are deleted from the shard, the series
ids are removed from the bitset.

Becasue each shard shares the same inmem index reference, the bitset
is stored in the `ShardIndex`, which is local to each shard, and then
different references are passed into the shared `Index` object, depending
on which shard is writing the series.
2018-01-11 01:01:54 +00:00
Edd Robinson e6f3aa107a Move SeriesSet to tsdb.SeriesIDSet 2018-01-11 01:01:54 +00:00