Commit graph

88 commits

Author SHA1 Message Date
Nikolay
be87be34a4 Adds tsdb match filters (#1282)
* init work on filters

* init propose for status filters

* fixes tsdb status
adds test

* fix bug

* removes checks from test
2021-05-12 17:16:58 +03:00
Aliaksandr Valialkin
ecfd6fe78d app/vmselect: remove -search.storageTimeout command-line flag, since it has the same meaning as -search.maxQueryDuration
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711
2021-03-30 14:54:36 +03:00
Aliaksandr Valialkin
7bafaad46d app/vmselect: prevent from possible incomplete query results after timed out query
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711
2021-03-30 13:34:57 +03:00
Aliaksandr Valialkin
05e301cfa0 app/vmselect/netstorage: reduce mutex contention when unpacking data on a system with high number of CPU cores 2021-03-16 21:52:05 +02:00
Aliaksandr Valialkin
1b90a091cf app/vmselect/netstorage: cleanup after 4805b80977 2021-02-24 11:43:09 +02:00
weng zhao
4805b80977
vmselect: fix vmselect cache partial result when timeout (#1085) 2021-02-24 11:39:56 +02:00
Aliaksandr Valialkin
73c9da16b8 app/vmselect/netstorage: reuse timeseriesWork objects in order to reduce memory allocations 2021-02-16 16:09:00 +02:00
Aliaksandr Valialkin
a3a09a3c6e app/vmselect/netstorage: use unsafe string as a key for a map when the map already contains the given key
This should prevent from a memory allocation and a string copy.
2021-02-16 15:46:31 +02:00
Aliaksandr Valialkin
1a237c6903 all: properly handle CPU limits set on the host system/container
This can reduce memory usage on systems with enabled CPU limits.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/946
2020-12-08 21:07:03 +02:00
Aliaksandr Valialkin
9660774fd1 app/vmselect/graphite: remove duplicate name tag from /tags/autoComplete/tags handler
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/942
2020-12-07 01:10:02 +02:00
Aliaksandr Valialkin
3d2ce31cad app/vmselect/netstorage: code readability improvement: rename *RequestErrors to *Errors 2020-11-23 15:00:15 +02:00
Aliaksandr Valialkin
433ae806ac app/vmselect: implement /tags/tagSeries and /tags/tagMultiSeries` in order to be consistent with single-node VictoriaMetrics 2020-11-23 14:57:08 +02:00
Aliaksandr Valialkin
7987129baa app/vmselect/netstorage: move common code for requests execution on all the storage nodes to startStorageNodesRequest func 2020-11-23 10:51:48 +02:00
Aliaksandr Valialkin
25a57ced6c app/vmselect/netstorage: prevent from data races in ProcessSearchQuery and in Export funcs when -replicationFactor > 1
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711
2020-11-23 10:25:51 +02:00
Aliaksandr Valialkin
f4fd917e4f lib/fs: replace fs.OpenReaderAt with fs.MustOpenReaderAt
All the callers for fs.OpenReaderAt expect that the file will be opened.
So it is better to log fatal error inside fs.MustOpenReaderAt instead of leaving this to the caller.
2020-11-23 09:57:30 +02:00
Aliaksandr Valialkin
1dcb438c3b app/vmselect/netstorage: typo fix after 990eb29a9b 2020-11-23 01:09:43 +02:00
Aliaksandr Valialkin
85eecf5801 app/vmselect/netstorage: add -replicationFactor command-line flag for reducing query duration when a part of vmstorage nodes are temporarily slow and/or temporarily unavailable
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711
2020-11-23 00:39:53 +02:00
Aliaksandr Valialkin
990eb29a9b app/vmselect/netstorage: move common code for collecting query results from vmstorage nodes to collectResults function 2020-11-23 00:16:02 +02:00
Aliaksandr Valialkin
ea4afb201b app/vmselect/netstorage: typo fix in a comment inside SearchMetricNames func 2020-11-18 01:35:37 +02:00
Aliaksandr Valialkin
f7f866d83b app/vmselect/netstorage: typo fix 2020-11-16 15:54:45 +02:00
Aliaksandr Valialkin
59fb75717e app/vmselect/netstorage: apply Graphite filter after substituting __name__ with name 2020-11-16 15:50:53 +02:00
Aliaksandr Valialkin
f2f16d8e79 app/vmselect/graphite: add /tags/autoComplete/tags handler from Graphite Tags API
See https://graphite.readthedocs.io/en/stable/tags.html#auto-complete-support
2020-11-16 14:58:10 +02:00
Aliaksandr Valialkin
eea1be0d5c app/vmselect/graphite: add /tags/findSeries handler from Graphite Tags API
See https://graphite.readthedocs.io/en/stable/tags.html#exploring-tags
2020-11-16 12:52:23 +02:00
Aliaksandr Valialkin
97100b1d42 app/vmselect/graphite: apply filter then limit 2020-11-16 12:52:18 +02:00
Aliaksandr Valialkin
5889273920 app/vmselect/graphite: add /tags/<tag_name> handler for Graphite Tags API 2020-11-16 03:41:41 +02:00
Aliaksandr Valialkin
99cb1a70cf app/vmselect/graphite: add /tags handler from Graphite Tags API
See https://graphite.readthedocs.io/en/stable/tags.html#exploring-tags
2020-11-16 02:57:20 +02:00
Aliaksandr Valialkin
2ac5f00d98 app/vmselect: propagate errors from vmstorage to response to the client if -search.denyPartialResponse command-line flag is set
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/891

This commit also adds `"isPartial":{true|false}` field to `/api/v1/*` responses. `"isPartial":true` is set when the response
is based on a partial data because some of vmstorage nodes weren't available during query processing.
2020-11-14 13:20:10 +02:00
Aliaksandr Valialkin
a78bf34ff3 app/vmselect: do not return isPartialResponse=true when all the storageNodes return errors 2020-11-10 18:48:57 +02:00
Aliaksandr Valialkin
c5e6c5f5a6 app/vmselect: optimize querying for /api/v1/labels and /api/v1/label/<name>/values when start and end args are set 2020-11-05 01:19:29 +02:00
Aliaksandr Valialkin
0d082cdf53 app/vmselect/netstorage: remove unused code 2020-09-29 11:55:08 +03:00
Aliaksandr Valialkin
db14f22fc0 app/vmselect: stop /api/v1/export/* execution if client disconnects 2020-09-27 23:52:42 +03:00
Aliaksandr Valialkin
aadbd014ff all: add native format for data export and import
The data can be exported via [/api/v1/export/native](https://victoriametrics.github.io/#how-to-export-data-in-native-format) handler
and imported via [/api/v1/import/native](https://victoriametrics.github.io/#how-to-import-data-in-native-format) handler.
2020-09-27 17:36:38 +03:00
Aliaksandr Valialkin
973df09686 app/vmselect/netstorage: do not spend CPU time on unpacking empty blocks during /api/v1/series calls 2020-09-24 20:44:15 +03:00
Aliaksandr Valialkin
0468cdf33e app/vmselect/netstorage: properly pre-allocate space for sbs 2020-09-22 23:51:01 +03:00
Aliaksandr Valialkin
9793008734 app/vmselect: add -search.storageTimeout command-line flag for limiting the maximum duration of query execution per each -storageNode
See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711
2020-09-16 21:33:47 +03:00
Aliaksandr Valialkin
a9205fe308 app/vmselect: prevent from closing connection to vmstorage on query timeout by setting +2 secs deadline on connection comparing to query deadline
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711
2020-09-16 21:14:00 +03:00
Aliaksandr Valialkin
1587f83fa0 app/vmselect/netstorage: typo fix after 03dfccfbed 2020-09-16 00:10:33 +03:00
Aliaksandr Valialkin
03dfccfbed app/vmselect/netstorage: reduce memory usage when the time range from query touches big number of samples per each time series 2020-09-15 21:08:09 +03:00
Aliaksandr Valialkin
27cd5555e6 app/vmselect/netstorage: mention that RunParallel or Cancel must be called on the returned results from ProcessSearchQuery 2020-09-15 20:39:43 +03:00
Aliaksandr Valialkin
d3ad0d365e app/vmselect: move Deadline from netstorage to searchutils
This removes dependency on netstorage from searchutils.
2020-09-11 13:39:13 +03:00
Aliaksandr Valialkin
f307e6f432 app/vmselect: initial implementation of Graphite Metrics API
See https://graphite-api.readthedocs.io/en/latest/api.html#the-metrics-api
2020-09-11 00:30:20 +03:00
Aliaksandr Valialkin
c9f5c5623f app/vmselect/netstorage: vary batch size for data unpacking depending on the available CPU cores
This should reduce contention on the channel with unpack work for systems with high number of CPU cores
2020-08-10 15:16:48 +03:00
Aliaksandr Valialkin
14ddb8a34e app/vmselect/netstorage: reduce CPU contention when upacking time series blocks by unpacking batches of such blocks instead of a single block
This should improve query performance on systems with big number of CPU cores (16 and more)
2020-08-06 17:50:13 +03:00
Aliaksandr Valialkin
46c98cd97a app/vmselect/netstorage: reduce contention on unpackworkCh and timeseriesWorkCh for multi-CPU system by providing more capacity for these chans 2020-08-06 17:22:39 +03:00
Aliaksandr Valialkin
fb3d1380ac lib/storage: respect -search.maxQueryDuration when searching for time series in inverted index
Previously the time spent on inverted index search could exceed the configured `-search.maxQueryDuration`.
This commit stops searching in inverted index on query timeout.
2020-07-23 21:22:05 +03:00
Aliaksandr Valialkin
dbf3038637 lib/storage: add more fine-grained pace limiting for search 2020-07-23 19:21:49 +03:00
Aliaksandr Valialkin
16a4b1b20c app/vmselect/netstorage: protect from too smart compiler, which may break memory usage optimization in tmpBlocksFileWrapper.WriteBlocks 2020-07-23 17:57:24 +03:00
Aliaksandr Valialkin
55ed07add1 app/vmselect: typo fix after 0168e21fe32776e2f7f003f88e0e6e490eb2dcb0g 2020-07-23 14:11:15 +03:00
Aliaksandr Valialkin
7aa5b48508 app/vmselect: reduce memory usage when querying big number of time series with long labels
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/646
2020-07-23 13:48:58 +03:00
Aliaksandr Valialkin
bd4299fafe app/vmselect/netstorage: reduce memory allocations when unpacking time series data by using a pool for unpackWork entries
This should slightly reduce load on GC when processing queries that touch big number of time series.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/646 according to the provided memory profile
2020-07-22 15:04:42 +03:00