components-contrib icon indicating copy to clipboard operation
components-contrib copied to clipboard

Apache Cassandra as stable candidate

Open addjuarez opened this issue 3 years ago • 2 comments

Describe the proposal

It seems conformance tests have already been setup for cassandra. https://github.com/dapr/components-contrib/blob/master/tests/conformance/common.go#L429 Now we need to create certification tests for cassandra to graduate component to stable. Currently cassandra supports CRUD operations and TTL. https://docs.dapr.io/reference/components-reference/supported-state-stores/setup-cassandra/

addjuarez avatar Jul 28 '22 05:07 addjuarez

Proposed tests

Test for TTL

  1. TTL not expiring
  2. TTL not a valid number
  3. TTL Expires as expected
    • Provide a TTL of 1 second
    • Fetch this record just after saving
    • Sleep for 2 seconds
    • Try to fetch again after a gap of 2 seconds, record shouldn't be deleted

Connection Recovery

  1. When Cassandra goes down and then comes back up the client is able to reconnect

Test Metadata Fields

  1. Verify port attribute is used

    • set port to non default value
    • run dapr application with component
    • component should successfully initialize
  2. Verify keyspace attribute is used

    • set keyspace to non-default value
    • run dapr application with component
    • component should successfully initialize and create keyspace
  3. Verify table attribute is used

    • set table to non-default value
    • run dapr application with component
    • component should successfully initialize and create table
    • successfully run query on table
  4. Verify protoVersion attribute is used

    • set protoVersion to non-default value 0
    • run dapr application with component
    • cassandra client itself should detect version from cluster if protoVersion == 0
    • component should successfully initialize
    • run queries to verify
  5. Verify replicationFactor attribute is used

    • set replicationFactor to non-default value 2
    • run dapr application with component using 2 nodes
    • component should successfully initialize
    • run queries to verify
  6. Verify consistency attribute is used - negative test

    • set consistency to non-default value "Three"
    • run dapr application with component
    • component should successfully initialize
    • run queries and see failure due to less than 3 nodes available
  7. Verify consistency attribute is used

    • set consistency to non-default value "One"
    • run dapr application with component
    • component should successfully initialize
    • run queries successfully

addjuarez avatar Jul 28 '22 15:07 addjuarez

/assign

addjuarez avatar Aug 02 '22 01:08 addjuarez

LGTM

artursouza avatar Aug 16 '22 20:08 artursouza

The CRUD operation are covered by conformance tests and should not be part of certification tests.

You also need tests covering the metadata options:

  - name: consistency
    value: <REPLACE-WITH-CONSISTENCY> # Optional. default: "All"
  - name: table
    value: <REPLACE-WITH-TABLE> # Optional. default: "items"
  - name: keyspace
    value: <REPLACE-WITH-KEYSPACE> # Optional. default: "dapr"
  - name: protoVersion
    value: <REPLACE-WITH-PROTO-VERSION> # Optional. default: "4"
  - name: replicationFactor
    value: <REPLACE-WITH-REPLICATION-FACTOR> #  Optional. default: "1"

berndverst avatar Aug 16 '22 21:08 berndverst

Metadata tests have now been added

addjuarez avatar Aug 17 '22 18:08 addjuarez

LGTM

berndverst avatar Aug 18 '22 20:08 berndverst