Reputation: 21
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:
I tried several ways to find out the reason and:
Upvotes: 2
Views: 67
Reputation: 16353
I haven't had the chance to replicate your issue but based on your description, my suspicion is that the system clock is behind by a few seconds so the DELETE
statement appears to be "delayed".
As Andy Tolbert explained in the post you linked in the comments section, the conditional DELETE
appears to "immediately remove" the record because the write-time on lightweight transactions (LWTs) are executed using server-side timestamps (instead of the default client-side timestamps for regular DELETE
statements).
If the clocks between the driver/client(s) and coordinator are out-of-sync, it can result in inconsistent behaviour for certain scenarios. Cheers!
Upvotes: 1
Reputation: 57798
So I suspect that this is due to the differences in how the Windows kernel works with certain operations. We had a discussion on this internally (at DataStax), and one thought is that there is likely a race condition with the LWT INSERT, resulting in the DELETE possibly happening before the INSERT takes effect. That's something that would be more apparent on Windows.
Bottom line: We stopped supporting Cassandra on Windows because Windows does some things which get in the way of Cassandra operating normally (issues with deleting active file handles). To test Cassandra single-node-style, use either Linux or MacOS, WSL, or a containerization/virtualization platform instead.
Upvotes: 2