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 lib/backup/s3remote: add retryer configuration (#6747) 2024-08-07 16:55:29 +02:00
blockcache all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
bloomfilter
bufferedwriter
buildinfo
bytesutil lib/bytesutil: smooth buffer growth rate (#6761) 2024-08-07 16:49:43 +02:00
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 testing: allow disabling fsync to make tests run faster (#6871) 2024-08-30 10:54:46 +02:00
fastnum
fasttime
filestream vlinsert: added opentelemetry logs support 2024-09-03 20:12:05 +02:00
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 app/{vminsert,vmagent}: add healthcheck for influx ingestion endpoints (#6749) 2024-08-05 09:34:54 +02:00
ingestserver Revert c6c5a5a186 and b2765c45d0 2024-07-03 23:51:56 +02:00
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 all: consistently use 'any' instead of 'interface{}' 2024-07-10 00:20:37 +02:00
memory
mergeset Revert "lib/mergeset: add sparse indexdb cache (#7269)" 2024-11-04 10:29:14 -03:00
metricsql
netutil lib/promscrape: fixes proxy autorization (#6783) 2024-08-19 22:31:18 +02:00
persistentqueue app/vmagent/remotewrite: follow-up for 87fd400dfc 2024-07-13 02:25:19 +02:00
procutil
promauth vmagent: add support of HTTP2 client for Kubernetes SD (#7114) 2024-10-08 10:36:31 +02:00
prompb Revert "Exemplar support (#5982)" 2024-07-03 15:30:21 +02:00
prompbmarshal Revert "Exemplar support (#5982)" 2024-07-03 15:30:21 +02:00
promrelabel lib/promrelabel: follow-up for 8958cecad6 2024-08-27 13:04:26 +02:00
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 lib/promscrape: fixes proxy autorization (#6783) 2024-08-19 22:31:18 +02:00
pushmetrics
querytracer make go vet happy 2024-08-19 21:15:33 +02:00
ratelimiter
regexutil
slicesutil
snapshot lib/httputils: parse URL before creating HTTP transport (#6820) 2024-08-16 11:32:04 +02:00
storage lib/storage: properly check for minMissingTimestamps 2024-11-15 16:25:13 +01:00
streamaggr tests: fix slice init length (#6897) 2024-08-30 10:55:25 +02:00
stringsutil all: consistently use stringsutil.JSONString() for formatting JSON strings with fmt.* functions instead of using "%q" formatter 2024-07-17 13:52:13 +02:00
syncwg
tenantmetrics
timerpool
timeutil app/vlinsert: support _time field without timezone information during data ingestion 2024-09-26 12:49:35 +02:00
uint64set lib/uint64set: optimize Set.Has() for nil Set - it should be inlined now 2024-07-15 23:59:20 +02:00
workingsetcache
writeconcurrencylimiter