VictoriaMetrics/lib
Nikolay 1985110de2
lib/storage: properly check for minMissingTimestamps
After changes at commit 787b9cd. Minimal timestamps for extDB check was performed without context of the index search prefix.
It worked fine for Single node version, but for cluster version a different prefix was used for
metricID search requests. It may lead to incomplete results, if minimal missing timestamp was cached
for the tenant with different ingestion patterns.

 Minimal reproducible case is:
- metrics were ingested for tenants 0 and 1
- at some point in time metrics ingestion for tenant 1 stopped
- index records have the following timestamps layout:
 tenant 0:  1,2,3,4,5,6
 tenant 1:  1,2,3,4
- after indexDB rotation, containsTimeRange lookups may produce
  incorrect results:
 time range request for tenant 1 - 5:6 caches 5 as min timestamp
 request for the same or smaller time range for tenant 0 now returns
empty results.

Second case:
- requests for the tenant without metrics always updates atomic value with incorrect minimal time range for other tenants.

 This commit replaces single atomic with map of search prefix keys. It should have slight performance overhead,
but work consistently for cluster version. minMissingTimestamp is cached by prefix search key, which included tenantID.

 Since it will be only populated at runtime, it doesn't hold unused tenants for queries.

Related issue:
https://github.com/VictoriaMetrics/VictoriaMetrics/issues/7417
2024-11-15 16:25:13 +01:00
..
appmetrics
auth
awsapi
backup
blockcache
bloomfilter
bufferedwriter
buildinfo
bytesutil
cgroup
contextutil
decimal
encoding
envflag
envtemplate
envutil
fastnum
fasttime
filestream
flagutil docs: follow-up after f0d1db81dc 2024-10-17 13:49:51 +02:00
formatutil
fs
htmlcomponents
httpserver tests: Initial version of integration tests (#7253) 2024-10-30 15:22:22 +01:00
httputils app/vlinsert: implement the ability to add extra fields to the ingested logs 2024-11-01 20:06:17 +01:00
influxutils
ingestserver
leveledbytebufferpool
logger
logstorage lib/logstorage: properly skip filtered out dict values when calculating uniq_values, min, max, row_min and row_max stats functions 2024-11-08 23:21:21 +01:00
lrucache
memory
mergeset Revert "lib/mergeset: add sparse indexdb cache (#7269)" 2024-11-04 10:29:14 -03:00
metricsql
netutil
persistentqueue
procutil
promauth
prompb
prompbmarshal
promrelabel
promscrape lib/promscrape: add relabel configs to global section 2024-10-31 19:58:22 +01:00
promutils
protoparser
proxy
pushmetrics
querytracer
ratelimiter
regexutil
slicesutil
snapshot
storage lib/storage: properly check for minMissingTimestamps 2024-11-15 16:25:13 +01:00
streamaggr
stringsutil
syncwg
tenantmetrics
timerpool
timeutil
uint64set
workingsetcache
writeconcurrencylimiter