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 lib/cgroup: round GOMAXPROCS to the lower integer value of cpuQuota 2024-09-23 16:09:12 +02:00
contextutil lib/contextutil: make golanci-lint happy by substituing unused function arg name with _ 2024-09-26 17:06:48 +02:00
decimal
encoding
envflag
envtemplate
envutil
fastnum
fasttime
filestream
flagutil docs: follow-up after f0d1db81dc 2024-10-17 13:49:51 +02:00
formatutil
fs fscore: rollback trailing space trim (#7106) 2024-09-29 10:59:25 +02:00
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 app/vlogscli: add interactive command-line tool for querying VictoriaLogs 2024-10-01 12:23:07 +02:00
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 vmagent: add support of HTTP2 client for Kubernetes SD (#7114) 2024-10-08 10:36:31 +02:00
prompb
prompbmarshal
promrelabel
promscrape lib/promscrape: add relabel configs to global section 2024-10-31 19:58:22 +01:00
promutils stream aggregation: fix possible duplicated aggregation results (#7118) 2024-09-30 14:24:59 +02:00
protoparser lib/protoparser/influx: enable batch processing by default (#7165) 2024-10-15 11:48:40 +02:00
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 app/vlinsert: support _time field without timezone information during data ingestion 2024-09-26 12:49:35 +02:00
uint64set
workingsetcache
writeconcurrencylimiter