Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-6625

Batch containing delete and insert leads to inconsistent results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Not A Problem
    • None
    • None
    • C* 1.2.11

    • Low

    Description

      On a single node cluster (i.e. ./bin/cassandra -f on localhost) we ran into the following. Let's consider empty keyspace with the following table:

      CREATE TABLE test (
          a varchar,
          b varchar,
          PRIMARY KEY (a, b)
      ) WITH comment='List of a related to b - widerow';
      

      The table is empty.

      Now we issue the following batch:

      BEGIN BATCH
      DELETE FROM test WHERE a = 'a1' AND b = 'b1';
      INSERT INTO test (a, b) VALUES ('a1', 'b1');
      APPLY BATCH;
      

      When the batch successfully finishes, the table is empty.

      This is consequence of the fact tombstone wins if timestamps are the same. And they are, because the operation is batched.

      I consider this a bug. Batching operations shouldn't change the semantics of batched operations.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ondrej.cernos Ondřej Černoš
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: