Commit Graph

9 Commits (8ed55e72b85b0807c97d3d1d7d12e9f07c9737e9)

Author SHA1 Message Date
Sam Arnold 781fa0e846 chore: add goimports 2021-01-29 14:06:52 -05: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
Edd Robinson 2b175291be
refactor: WIP removing tsbd 2020-08-03 09:18:34 -07:00
Jonathan A. Sternberg 5aeca082c8
chore: update staticcheck and fix newly identified lint checks (#18737) 2020-06-26 18:54:09 -05:00
Edd Robinson 19a36e0dc7 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 13:38:22 +00:00
Edd Robinson 7ee4f499e1 Clarify best method of set difference 2019-01-14 12:46:53 +00:00
Mark Rushakoff 1ab9c80ae8 fix(tsdb): eliminate data race from *SeriesIDSet.Clone
And add a test to cover that.

The data race would look roughly like:

```
WARNING: DATA RACE
Write at 0x00c000024e18 by goroutine 8:
  github.com/RoaringBitmap/roaring.(*roaringArray).markAllAsNeedingCopyOnWrite()
      /Users/mr/go/pkg/mod/github.com/!roaring!bitmap/roaring@v0.4.16/roaringarray.go:881 +0x6b
  github.com/RoaringBitmap/roaring.(*roaringArray).clone()
      /Users/mr/go/pkg/mod/github.com/!roaring!bitmap/roaring@v0.4.16/roaringarray.go:266 +0x808
  github.com/RoaringBitmap/roaring.(*Bitmap).Clone()
      /Users/mr/go/pkg/mod/github.com/!roaring!bitmap/roaring@v0.4.16/roaring.go:385 +0x58
  github.com/influxdata/platform/tsdb.(*SeriesIDSet).CloneNoLock()
      /Users/mr/go/src/github.com/influxdata/platform/tsdb/series_set.go:229 +0x73
  github.com/influxdata/platform/tsdb.(*SeriesIDSet).Clone()

Previous write at 0x00c000024e18 by goroutine 7:
  github.com/RoaringBitmap/roaring.(*roaringArray).markAllAsNeedingCopyOnWrite()
      /Users/mr/go/pkg/mod/github.com/!roaring!bitmap/roaring@v0.4.16/roaringarray.go:881 +0x6b
  github.com/RoaringBitmap/roaring.(*roaringArray).clone()
      /Users/mr/go/pkg/mod/github.com/!roaring!bitmap/roaring@v0.4.16/roaringarray.go:266 +0x808
  github.com/RoaringBitmap/roaring.(*Bitmap).Clone()
      /Users/mr/go/pkg/mod/github.com/!roaring!bitmap/roaring@v0.4.16/roaring.go:385 +0x58
  github.com/influxdata/platform/tsdb.(*SeriesIDSet).CloneNoLock()
      /Users/mr/go/src/github.com/influxdata/platform/tsdb/series_set.go:229 +0x73
  github.com/influxdata/platform/tsdb.(*SeriesIDSet).Clone()
      /Users/mr/go/src/github.com/influxdata/platform/tsdb/series_set.go:223 +0x7b
```
2018-11-13 08:12:38 -08:00
Edd Robinson 3385f389f7 Update tsdb package from OSS 2018-10-01 12:08:37 +01:00