Delete-Upsert-Read Access Pattern in Cassandra <p>I use Cassandra to store trading information. Based on the queries available, I design my CF as below:</p> <pre><code>CREATE trades (trading_book text, trading_date timestamp, OTHER TRADING INFO ..., PRIMARY KEY (trading_book, trading_date)); </code></pre> <p>I want to delete all the data on a given date in the following way:</p> <ol> <li>collect all the trading books (which are stored somewhere else);</li> <li>evenly distribute all the trading books in 20 threads;</li> <li>in each thread, loop through the books, and</li> </ol> <p>DELETE FROM trades WHERE trading_book='A_BOOK' AND trading_date='2015-01-01'</p> <p>There are about 1 million trades and the deletion takes 2 min to complete. Then insert the trading data on 2015-01-01 again (about 1 million trades) immediate after the deletion done.</p> <p>When the insertion done and I re-read the data, I got the error even with query timeout set to 600 seconds:</p> <pre><code>ReadTimeout: code=1200 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'} info={'received_responses': None, 'required_responses': None, 'consistency': 'Not Set'} </code></pre> <p>It looks like some data inconsistency in the CF now, i.e. the coordinator could identify the partition, but there is no data on the partition?</p> <p>Is there anything wrong with my access pattern? How to solve this problem?</p> <p>Any hints will be highly appreciated! Thank you.</p>