Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cassandra role consistency level #287

Merged
merged 31 commits into from
Oct 13, 2024
Merged

Conversation

rhysmeister
Copy link
Collaborator

SUMMARY

Take over of #284

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

cassandra_role

Демьяненко Александр Сергеевич and others added 3 commits July 18, 2024 17:53
@rhysmeister
Copy link
Collaborator Author

Should also be added to...

  • cassandra_keyspace
  • cassandra_table

and then refactored at some point, to cassandra_common.py, as described in #248

@rhysmeister
Copy link
Collaborator Author

rhysmeister commented Oct 11, 2024

Note the tests for ANY consistency level...

- name: Create a test role - ANY consistency
  community.cassandra.cassandra_role:
    name: any_role
    password: p4ssw0rd
    login: true
    keyspace_permissions:
      test_keyspace:
        - "ALL PERMISSIONS"
    state: present
    login_user: "{{ cassandra_admin_user }}"
    login_password: "{{ cassandra_admin_pwd }}"
    debug: yes
    consistency_level: "ANY"
  ignore_errors: true
  register: any

- assert:
    that:
      - any.failed
      - "'ANY ConsistencyLevel is only supported for writes' in any.msg"

For this feature to be fully usable we need to create separate connections for read and write.

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.29%. Comparing base (a94515f) to head (82866ce).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #287      +/-   ##
==========================================
- Coverage   72.13%   71.29%   -0.85%     
==========================================
  Files          37       26      -11     
  Lines        2688     1895     -793     
  Branches      605      403     -202     
==========================================
- Hits         1939     1351     -588     
+ Misses        394      293     -101     
+ Partials      355      251     -104     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rhysmeister
Copy link
Collaborator Author

rhysmeister commented Oct 12, 2024

Here is a summary of the support consistency levels for reads and writes...

Consistency Level Read Write
ANY No Yes
ONE Yes Yes
TWO Yes Yes
THREE Yes Yes
QUORUM Yes Yes
ALL Yes Yes
LOCAL_ONE Yes Yes
LOCAL_QUORUM Yes Yes
EACH_QUORUM No Yes
SERIAL Yes No
LOCAL_SERIAL Yes No

We should update the code to reflect this. If the consistency level is not supported, we simply skip applying it.

@rhysmeister rhysmeister merged commit de87974 into master Oct 13, 2024
344 of 345 checks passed
@rhysmeister rhysmeister deleted the cassandra_role_consistency_level branch October 13, 2024 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant