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

get/set guardrails configuration via CQL

    XMLWordPrintableJSON

Details

    • Operability
    • Normal
    • All
    • None
    • Hide

      still need to finish test, I am just interested in the review for a general approach

      Show
      still need to finish test, I am just interested in the review for a general approach

    Description

      In CASSANDRA-19552, there is a patch which modifies guardrails via nodetool and via reflection.

      I think that it will be better if we do that via CQL.

      So far, I have this:

      cqlsh> select * from system_views.guardrails_threshold ;
      
       name                          | fail  | warn
      -------------------------------+-------+-------
                     collection_size |     0 |     0
                   column_value_size |    -1 |    -1
                   columns_per_table |    -1 |    -1
                      fields_per_udt |    -1 |    -1
         in_select_cartesian_product |    -1 |    -1
                items_per_collection |    -1 |    -1
                           keyspaces |    -1 |    -1
        materialized_views_per_table |    -1 |    -1
          maximum_replication_factor |    -1 |    -1
                   maximum_timestamp |     0 |     0
          minimum_replication_factor |    -1 |    -1
                   minimum_timestamp |     0 |     0
                           page_size |    -1 |    -1
            partition_keys_in_select |    -1 |    -1
                      partition_size | 40960 | 20480
                partition_tombstones |    -1 |    -1
       sai_sstable_indexes_per_query |    -1 |    32
         secondary_indexes_per_table |    -1 |    -1
                              tables |    -1 |    -1
                   vector_dimensions |    -1 |    -1
      
      cqlsh> update system_views.guardrails_threshold SET warn = 16, fail = 20 where name = 'sai_sstable_indexes_per_query';
      
      cqlsh> select * from system_views.guardrails_threshold where name = 'sai_sstable_indexes_per_query';
      
       name                          | fail | warn
      -------------------------------+------+------
       sai_sstable_indexes_per_query |   20 |   16
      
      INFO  [Native-Transport-Requests-1] 2024-04-11 11:51:24,483 GuardrailsOptions.java:998 - Updated sai_sstable_indexes_per_query_warn_threshold from 32 to 16
      INFO  [Native-Transport-Requests-1] 2024-04-11 11:51:24,483 GuardrailsOptions.java:998 - Updated sai_sstable_indexes_per_query_fail_threshold from -1 to 20
      
      cqlsh> update system_views.guardrails_threshold SET warn = 10, fail = 5 where name = 'sai_sstable_indexes_per_query';
      InvalidRequest: Error from server: code=2200 [Invalid query] message="The warn threshold 10 for sai_sstable_indexes_per_query_warn_threshold should be lower than the fail threshold 5"
      

      We can easily extend this to EnableFlag guardrails for which we would dedicate a separate table (system_views.guadrails_flag).

      Other guardrail types are being investigated.

      Attachments

        Issue Links

          Activity

            People

              smiklosovic Stefan Miklosovic
              smiklosovic Stefan Miklosovic
              Stefan Miklosovic
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

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