Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-17189

Guardrail for page size

    XMLWordPrintableJSON

Details

    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:

      1. Add the configuration for the new guardrail on page size in the guardrails section of cassandra.yaml.
      2. Add a getPageSize method in GuardrailsConfig returning a Threshold.Config object
      3. Implement that method in GuardrailsOptions, which is the default yaml-based implementation of GuardrailsConfig
      4. Add a Threshold guardrail named pageSize in Guardrails, using the previously created config
      5. Define JMX-friendly getters and setters for the previously created config in GuardrailsMBean
      6. Implement the JMX-friendly getters and setters in Guardrails
      7. 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.
      8. Finally, add some tests for the new guardrail. Given that the new guardrail is a Threshold, our new test should probably extend ThresholdTester.

      Attachments

        1. CASSANDRA-17189-trunk.diff
          17 kB
          Bartlomiej

        Issue Links

          Activity

            People

              bkowalczyyk Bartlomiej
              adelapena Andres de la Peña
              Bartlomiej
              Andres de la Peña, Brandon Williams
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h