Temporary blacklisting of queries that ends up scanning large number of rows #791
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We use opentsdb as our metric system for application and system health monitoring.
Some times, we end up having a scenario in which one of region server becomes hot spotted due to a query that scans large number of rows. This is due to the high cardinality for the metric and time range for which the query is issued.
To mitigate this scenario, we've implemented a temporary blacklisting on such queries. The code change is attached as a patch file with this email.
This change has been done in the query layer because it has the right contextual information like rows scanned to best take the decision about blacklisting. This code change will reactively blacklist queries that scan more than 'n' rows for a specific duration of time 't'. This feature can be turned off/on via config and it's off by default. Settings like max number of records ('n'), blacklist interval ('t') is configurable via config file.
Currently this change works only when the query is made using the metric name and does not handle the scenario where the query is based on TSUID.