[ 
https://issues.apache.org/jira/browse/CASSANDRA-17188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17472671#comment-17472671
 ] 

Andres de la Peña edited comment on CASSANDRA-17188 at 1/11/22, 12:13 PM:
--------------------------------------------------------------------------

The proposed patch adds guardrails to warn about or reject read/write 
consistency levels:
||PR||CI||
|[trunk|https://github.com/apache/cassandra/pull/1392]|[j8|https://app.circleci.com/pipelines/github/adelapena/cassandra/1232/workflows/e733629c-3559-4999-9ea7-14b71bc30c2c]
 
[j11|https://app.circleci.com/pipelines/github/adelapena/cassandra/1232/workflows/4a59214a-abd9-40a5-a134-7cc05741ae55]|

The part for write consistency levels is based on a previous patch written by 
[~Gerrrr]. 

Some queries can trigger internal queries that use a different consistency 
level than that specified for the user. For example, certain write operations 
on lists can [trigger a 
read|https://github.com/adelapena/cassandra/blob/bc20bddcebd6a37b14cfbdd50c359be4c9743f73/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java#L396].
 As another example, the different phases of Paxos in LWT can [internally use 
multiple consistency 
levels|https://github.com/adelapena/cassandra/blob/bc20bddcebd6a37b14cfbdd50c359be4c9743f73/src/java/org/apache/cassandra/service/StorageProxy.java#L445-L447].
 These internal consistency levels are not verified by the proposed guardrails, 
which are only applied to the regular and serial consistency levels explicitly 
specified by the user.

The patch modifies [the existing {{Values}} type of 
guardrail|https://github.com/adelapena/cassandra/blob/bc20bddcebd6a37b14cfbdd50c359be4c9743f73/src/java/org/apache/cassandra/db/guardrails/Values.java#L40-L41]
 to have [a list of {{warned}} 
values|https://github.com/adelapena/cassandra/blob/17188-trunk/src/java/org/apache/cassandra/db/guardrails/Values.java#L41-L43].
 I think that this set of {{warned}} values can also be useful for the already 
existing guardrail for table properties. I have modified that guardrail to also 
include warned properties, in addition to the current sets of ignored and 
disallowed properties:
{code:java}
# Guardrail to warn about, ignore or reject properties when creating tables.
table_properties:
    warned: []
    ignored: []
    disallowed: []
{code}


was (Author: adelapena):
The proposed patch adds guardrails to warn about or reject read/write 
consistency levels:
||PR||CI||
|[trunk|https://github.com/apache/cassandra/pull/1392]|[j8|https://app.circleci.com/pipelines/github/adelapena/cassandra/1232/workflows/e733629c-3559-4999-9ea7-14b71bc30c2c]
 
[j11|https://app.circleci.com/pipelines/github/adelapena/cassandra/1232/workflows/4a59214a-abd9-40a5-a134-7cc05741ae55]|

The part for write consistency levels is based on a previous patch written by 
[~Gerrrr]. 

Some queries can trigger internal queries that use a different consistency 
level than that specified for the user. For example, certain write operations 
on lists can trigger a read. As another example, the different phases of Paxos 
in LWT can internally use multiple consistency levels. These internal 
consistency levels are not verified by the proposed guardrails, which are only 
applied to the regular and serial consistency levels explicitly specified by 
the user.

The patch modifies the existing {{Values}} type of guardrail to have a list of 
{{warned}} values. I think that this set of {{warned}} values can also be 
useful for the already existing guardrail for table properties. I have modified 
that guardrail to include warned properties, in addition to the current ignored 
and disallowed properties:
{code:java}
# Guardrail to warn about, ignore or reject properties when creating tables.
table_properties:
    warned: []
    ignored: []
    disallowed: []
{code}

> Guardrails for consistency levels
> ---------------------------------
>
>                 Key: CASSANDRA-17188
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17188
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Feature/Guardrails
>            Reporter: Andres de la Peña
>            Assignee: Andres de la Peña
>            Priority: Normal
>             Fix For: 4.x
>
>
> Add guardrails for read/write consistency levels, for example:
> {code:java}
> # Guardrail to warn about or reject read consistency levels.
> # By default all consistency levels are allowed.
>     read_consistency_levels:
>         warned: []
>         disallowed: []
> # Guardrail to warn about or reject write consistency levels.
> # By default all consistency levels are allowed.
>     write_consistency_levels:
>         warned: []
>         disallowed: []
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to