Commit Graph

11 Commits (522c32754c95da79c3811b397ded4ff4f75c33e0)

Author SHA1 Message Date
Ayan George 42873d4424
chore: Quiet static analysis tools (#19509)
* Remove redundant type in slice/array declarations.
* Call t.Fatal() from test-functions, not non-test go-routines.
* Remove unnecessary empty value operator from ranges.
* Call defer .Close() methods only after checking for error on Open().
2020-09-05 12:43:29 -04:00
Ayan George 3b9be0145c
fix: address static check warning s1039 (#18135)
This commit quiets staticcheck's warnings about "unnecessary use of
fmt.Sprintf" and "unnecessary use of fmt.Sprint".

Prior to this commit we were wrapping simple constant strings without
any formatting verbs with fmt.Sprintf().
2020-05-18 13:55:05 -04:00
Ben Johnson 848ca48225 fix(tsdb): Revert "fix: remove some unsafe marshalling to reduce risk of segfault"
This reverts commit 30dab03310.
2020-04-13 13:22:22 -06:00
docmerlin (j. Emrys Landivar) 30dab03310 fix: remove some unsafe marshalling to reduce risk of segfault
We were seing segfaults in Roaring bitmaps sometimes, under very
high load with networked drives.  This may reduce risk of segfault by
forcing marshalling to copy the data.
2020-03-11 13:47:29 -04:00
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 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 81f640e9ae Add more methods and benchmarks to SeriesIDSet 2018-09-18 15:58:38 -07:00
Edd Robinson 4ccb6ada69 Remove unused code/cleanup tsdb package 2018-01-20 14:06:15 +00:00
Edd Robinson bd762380b0 Use bitsets to calculate series cardinality 2018-01-16 23:22:52 +00:00
Edd Robinson b0e6aeb64c Add some series file testing 2018-01-15 12:00:30 +00:00