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

Losing writes in a single-node cluster

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • Docker images

    • Normal

    Description

      I am able to reliably reproduce write losses in the following circumstances:

      • Set up a single-node cluster.
      • Create keyspace with SimpleStrategy, replication_factor = 1.
      • Create a table with a float field.
      • Send an UPDATE command to set the float value on a row.
      • After the command returns, immediately send another UPDATE to set the float value to something smaller than the first value.
      • The second UPDATE is sometimes lost.

      Reproduction code attached. There are two implementations: one in Go and one in C++. They do the same thing – I implemented both to rule out a bug in the client library. For both cases, you can reproduce by doing the following:

      1. docker run --name repro-cassandra --rm cassandra:2.0.14
      (or any other Cassandra version)
      2. Download and unzip one of the zip files, and change to its directory.
      3. docker build -t repro .
      4. docker run --link repro-cassandra:cassandra --rm repro

      The reproduction code will repeatedly run two UPDATEs followed by a SELECT until it detects a lost write, and then print:

      "Lost a write. Got 20.500000, want 10.500000"

      This may be fixed in 2.1.8 because I have not been able to reproduce it in that version.

      Attachments

        1. cpp-repro.zip
          2 kB
          Jeremy Schlatter
        2. go-repro.zip
          1 kB
          Jeremy Schlatter

        Activity

          People

            sylvestor88 Sylvestor George
            jeremyschlatter Jeremy Schlatter
            Sylvestor George
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: