[
https://issues.apache.org/jira/browse/CASSANDRA-14981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16742919#comment-16742919
]
Timur Tibeyev commented on CASSANDRA-14981:
-------------------------------------------
[~djoshi3]
Please check my sample repo
[cassandra-cluster-test|https://github.com/timurt/cassandra-cluster-test]
Here are the steps;
1) Starting docker containers with `docker-compose up`
2) Connecting to any `Cassandra` node with `cqlsh`, creating keyspace with
replication factor 2, creating table and adding trigger to table
3) Executing some simple inserts, updates, deletes to check triggers
4) Connect to `Kafka` broker using console consumer and checking record
messages - do they correspond to `cql` queries or not
Next steps to reproduce exception
5) shut down any two nodes
6) connect to last working node with `cqlsh`
7) Execute insert queries, some of them will fail with `NoHostAvailable`
exception, some of them not
8) Check `Kafka` consumer log, you will see all messages, even those, which
were not written to Database
After all you can start nodes and perform `select`, data in `Cassandra` and in
`Kafka` mismatches
Hope it will help
> Cassandra fires NoHostAvailable exception, but trigger receives update
> ----------------------------------------------------------------------
>
> Key: CASSANDRA-14981
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14981
> Project: Cassandra
> Issue Type: Bug
> Environment: cassandra 3.11.3
> Reporter: Timur Tibeyev
> Priority: Major
> Attachments: Cassandra.png, Kafka consumer.png
>
>
> Cluster
> I have cluster with three nodes, cluster is created via `docker-compose`.
> All nodes in the cluster have `UN` (up normal) status, checked with
> `nodetool status`.
>
> Trigger
> Trigger receives event and produces `Kafka` record.
> All three nodes have same trigger.
>
> Table
> Here is my CQL query, `users` table replication factor is 2
> Consistency level is one
> ```
> CREATE KEYSPACE mytestdb WITH replication = \{ 'class':'SimpleStrategy',
> 'replication_factor':2 };
> USE mytestdb;
> CREATE TABLE IF NOT EXISTS users (
> id uuid,
> username text,
> phone text,
> lastname text,
> firstname text,
> PRIMARY KEY (id)
> );
> CREATE TRIGGER kafka_trigger ON users USING 'org.company.CassandraTrigger';
> ```
>
> Problem
> Everything worked fine so I wanted to check edge cases, I intentionally shut
> down 2 nodes, to check how `Cassandra` and trigger will perform.
> I started to make queries to single working node.
> Some inserts were processed correctly, but for some of them `NoHostAvailable`
> exception occurred, but trigger received this "failed" insert event and
> produced normal `Kafka` record
> The problem is - data was not saved to `Cassandra`, but trigger received
> update.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]