grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.96k stars 3.46k forks source link

feat(TSDB): allow tsdb index creation in memory only #14732

Closed owen-d closed 2 weeks ago

owen-d commented 2 weeks ago

In preparation for creating stateless ingesters, this PR adds support for TSDBs to be created by using memory as the backing temporary store rather than disk. This paves the way towards an easier operating model which doesn't require disks.

Note: this adds support but doesn't use it in any existing code paths. I've essentially refactored the TSDB creator to use an interface which can be satisfied by disk or memory. The old code paths will continue to use disks for now to minimize changes.

# index files built pre and post change are byte equivalent
$ cmp 1730487398326535000-compactor-1000-3000-bd34932f.tsdb 1730487451442167000-compactor-1000-3000-bd34932f.tsdb