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

repair vtables should expose a completed field due to lack of filtering options in CQL

    XMLWordPrintableJSON

Details

    Description

      To find repairs actively running, we need to run the following command

      SELECT * 
      FROM system_views.repairs 
      WHERE status IN ('setup', 'start', 'prepare_start', 'prepare_complete', 'repair_start', 'repair_complete')
      ALLOW FILTERING;
      

      This is annoying, and a problem if more states are added in the future…. Ideally we would do one of the following

      NOT IN:

      status NOT IN (’success’, ’skip’, ‘failure’)
      

      But this is not currently supported

      cqlsh> select * from system_views.repairs WHERE duration_millis > 10 AND status NOT IN ('success', 'failure') ALLOW FILTERING;
      SyntaxException: line 1:73 no viable alternative at input 'NOT' (...WHERE duration_millis > 10 AND [status] NOT...)
      

      Not Equals

      cqlsh> select * from system_views.repairs WHERE duration_millis > 10 AND status != 'success' AND status !='failure' ALLOW FILTERING;
      InvalidRequest: Error from server: code=2200 [Invalid query] message="Unsupported "!=" relation: status != 'success'"
      

      This also fails

      cqlsh> select * from system_views.repairs WHERE duration_millis > 10 AND status != 'success' AND status !='failure' ALLOW FILTERING;
      InvalidRequest: Error from server: code=2200 [Invalid query] message="Unsupported "!=" relation: status != 'success'"
      

      NULL Checking

      state_success_timestamp IS NULL AND state_failure_timestamp IS NULL
      — OR
      state_success_timestamp=null AND state_failure_timestamp=null
      

      This also fails

      cqlsh> select * from system_views.repairs WHERE duration_millis > 10 AND state_success_timestamp IS NULL ALLOW FILTERING;
      SyntaxException: line 1:93 mismatched input 'NULL' expecting K_NOT (...> 10 AND state_success_timestamp IS [NULL]…)
      cqlsh> select * from system_views.repairs WHERE duration_millis > 10 AND state_success_timestamp=null ALLOW FILTERING;
      InvalidRequest: Error from server: code=2200 [Invalid query] message="Unsupported null value for column state_success_timestamp"
      

      Given that our filtering logic is restrictive, we need a column to expose if completed or not, so filtering works

      Attachments

        Issue Links

          Activity

            People

              dcapwell David Capwell
              dcapwell David Capwell
              David Capwell
              Chris Lohfink, Zhao Yang
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 10m
                  10m