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

Guardrail for number of partition keys on IN queries

    XMLWordPrintableJSON

Details

    Description

      Add a guardrail for limiting the number of partitions restricted with an IN clause in a SELECT query, for example:

      # Guardrail to warn or abort when querying with an IN restriction selecting
      # more partition keys than threshold.
      # The two thresholds default to -1 to disable. 
      partition_keys_in_select:
          warn_threshold: -1
          abort_threshold: -1
      

      Additional information for newcomers:

      • Add the configuration for the new guardrail on the number of partitions on IN queries in the guardrails section of cassandra.yaml.
      • Add a getPartitionKeysInSelect 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 partitionKeysInSelect 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.partitionKeysInSelect#guard method with the number of keys specified in select query. The SelectStatement#getSliceCommands 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

        Issue Links

          Activity

            People

              tejavadali Krishna Vadali
              adelapena Andres de la Peña
              Krishna Vadali
              Andres de la Peña, Berenguer Blasi
              Votes:
              0 Vote for this issue
              Watchers:
              6 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 - 4h 20m
                  4h 20m