Details
-
New Feature
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
Operability
-
Low Hanging Fruit
-
All
-
None
-
Description
Add guardrail limiting the query page size, for example:
# Guardrail to warn about or reject page sizes greater than threshold.
# The two thresholds default to -1 to disable.
page_size:
warn_threshold: -1
abort_threshold: -1
Initially this can be based on the specified number of rows used as page size, although it would be ideal to also limit the actual size in bytes of the returned pages.
Additional information for newcomers:
- Add the configuration for the new guardrail on page size in the guardrails section of cassandra.yaml.
- Add a getPageSize method in GuardrailsConfig returning a Threshold.Config object
- Implement that method in GuardrailsOptions, which is the default yaml-based implementation of GuardrailsConfig
- Add a Threshold guardrail named pageSize in Guardrails, using the previously created config
- Define JMX-friendly getters and setters for the previously created config in GuardrailsMBean
- Implement the JMX-friendly getters and setters in Guardrails
- Now that we have the guardrail ready, it’s time to use it. We should search for a place to invoke the Guardrails.pageSize#guard method with the page size that each query is going to use. The DataLimits#forPaging methods look like good candidates for this.
- Finally, add some tests for the new guardrail. Given that the new guardrail is a Threshold, our new test should probably extend ThresholdTester.
Attachments
Attachments
Issue Links
- links to