We have an existing table:
CREATE TABLE IF NOT EXISTS alert_logs ( org_id decimal, type text, subtype text, valid_from timestamp, effective_time timestamp, valid_to timestamp, id text, PRIMARY KEY ((org_id, type, subtype), valid_from, effective_time, valid_to, id) );
Updated the table to apply user level ownership of each row and created an index to query on user.
ALTER TABLE alert_logs ADD USERS set<decimal>; CREATE INDEX IF NOT EXISTS ON alert_logs ( USERS );
We have a heavy writing application. 100s of writes from multiple threads at the same time into the same partition. 10% of insert queries are failing with the following error:
com.datastax.driver.core.exceptions.WriteTimeoutException: Cassandra timeout during SIMPLE write query at consistency LOCAL_QUORUM (2 replica were required but only 1 acknowledged the write)
Each row user's set may have 200 values. these combinations repeats for each row.
Why write timeouts are happening?
Is the secondary index a good choice here?