Details
-
Improvement
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Operability
-
Low Hanging Fruit
-
All
-
None
-
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