VictoriaMetrics/app/vmstorage
Nikolay 30b32583f4
lib/storage: pre-create timeseries before indexDB rotation (#4652)
* lib/storage: pre-create timeseries before indexDB rotation
during an hour before indexDB rotation start creating records at the next indexDB
it must improve performance during switch for the next indexDB and remove ingestion issues.
Since there is no need for creation new index records for timeseries already ingested into current indexDB
https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4563

* lib/storage: further work on indexdb rotation optimization

- Document the change at docs/CHAGNELOG.md
- Move back various caches from indexDB to Storage. This makes the change less intrusive.
  The dateMetricIDCache now takes into account indexDB generation, so it stores (date, metricID)
  entries for both the current and the next indexDB.
- Consolidate the code responsible for idbNext pre-filling into prefillNextIndexDB() function.
  This improves code readability and maintainability a bit.
- Rewrite and simplify the code responsible for calculating the next retention timestamp.
  Add various tests for corner cases of this code.
- Remove indexdb pre-filling from RegisterMetricNames() function, since this function is rarely called.
  It is OK to add indexdb entries on demand in this function. This simplifies the code.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1401

* docs/CHANGELOG.md: refer to https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4563

---------

Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
2023-07-22 15:23:14 -07:00
..
deployment Rootless docker images by default (#358) 2020-03-27 21:18:32 +02:00
multiarch all: run apk update && apk upgrade in base Alpine Docker image in order to get all the recent security fixes 2023-02-09 14:03:02 -08:00
servers lib/storage: switch from global to per-day index for MetricName -> TSID mapping 2023-07-13 17:03:50 -07:00
main.go lib/storage: pre-create timeseries before indexDB rotation (#4652) 2023-07-22 15:23:14 -07:00
Makefile all: add Windows build for VictoriaMetrics 2023-03-19 23:28:26 -07:00
README.md all: open-sourcing cluster version 2019-05-23 00:25:38 +03:00

vmstorage performs the following tasks:

  • Accepts inserts from vminsert nodes and stores them to local storage.

  • Performs select requests from vmselect nodes.