prometheus/tsdb/wal
Bryan Boreham 60804c5a09
remote_write: reduce blocking from garbage-collect of series (#9109)
* Refactor: pass segment-reading function as param

To allow a different implementation to be used when garbage-collecting.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* remote_write: reduce blocking from GC of series

Add a method `UpdateSeriesSegment()` which is used together with
`SeriesReset()` to garbage-collect old series. This allows us to
split the lock around queueManager series data and avoid blocking
`Append()` while reading series from the last checkpoint.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Cosmetic: review feedback on comments

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* remote-write benchmark: include GC of series

Reduce the total number of samples per iteration from 5000*5000
(25 million) which is too big for my laptop, to 1*10000.

Extend `createTimeseries()` to add additional labels, so that the
queue manager is doing more realistic work.

Move the Append() call to a background goroutine - this works because
TestWriteClient uses a WaitGroup to signal completion.

Call `StoreSeries()` and `SeriesReset()` while adding samples, to
simulate the garbage-collection that wal.Watcher does.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Change BenchmarkSampleDelivery to call UpdateSeriesSegment

This matches what Watcher.garbageCollectSeries() is doing now

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2021-07-27 13:21:48 -07:00
..
checkpoint.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
checkpoint_test.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
live_reader.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
reader.go Moving tsdb into its own subdirectory 2019-08-13 13:58:49 +05:30
reader_test.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
wal.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
wal_test.go Cleanup tempfiles in tests (#8179) 2021-01-15 13:49:57 +05:30
watcher.go remote_write: reduce blocking from garbage-collect of series (#9109) 2021-07-27 13:21:48 -07:00
watcher_test.go remote_write: reduce blocking from garbage-collect of series (#9109) 2021-07-27 13:21:48 -07:00