Illustration Image

Delete doesn't work immediately on single node Cassandra database

My problem is that I am not getting immediate delete on single node Cassandra. The problem occurs only on Windows, when I run Cassandra in Docker container. There is no problem on Linux. I am using datastax driver to connect to Cassandra from Java application. Flow in test looks like:

  1. Insert single row to my_lock_table
  2. Modify schema (same keyspace, creating additional tables, it takes about 300ms)
  3. Delete row from my_lock_table by partition key
  4. Select row from my_lock_table by partition key - on Linux there is no result as I expected. But on Windows row that is supposed to be removed is returned by SELECT.

I tried several ways to find out the reason and:

  1. When I added IF EXISTS clause to the delete query, then it works properly row is gone instantly.
  2. I tried to delete row again, and it didn't help. It is strange because it doesn't matter how many times I call DELETE query - it will not work until 10 seconds have passed. And after 10 seconds since INSERT, if I call DELETE query again, then it works and the row is gone.
  3. I checked logs of cassandra, and timestamps of queries are in proper order.
Become part of our
growing community!
Welcome to Planet Cassandra, a community for Apache Cassandra®! We're a passionate and dedicated group of users, developers, and enthusiasts who are working together to make Cassandra the best it can be. Whether you're just getting started with Cassandra or you're an experienced user, there's a place for you in our community.
A dinosaur
Planet Cassandra is a service for the Apache Cassandra® user community to share with each other. From tutorials and guides, to discussions and updates, we're here to help you get the most out of Cassandra. Connect with us and become part of our growing community today.
© 2009-2023 The Apache Software Foundation under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation. Sponsored by Anant Corporation and Datastax, and Developed by Anant Corporation.

Get Involved with Planet Cassandra!

We believe that the power of the Planet Cassandra community lies in the contributions of its members. Do you have content, articles, videos, or use cases you want to share with the world?