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

Removing an element from map<any type, tinyint/smallint> corrupts commitlog

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Urgent
    • Resolution: Fixed
    • 3.0.6, 3.6
    • Fully updated CentOS 7.2 64-bit (ami-1f5dfe6c: "CentOS 7.2 x86_64 with cloud-init (HVM)") on Amazon's eu-west-1c t2.micro + OpenJDK 1.8.0_77
      Arch Linux 32-bit + OpenJDK 8.u77-1

    Description

      2.2.6 has no this bug.
      I've tried 3.0 alpha 1, 3.0 beta 1, 3.0 beta 2, 3.0.0, 3.0.6, 3.5, datastax-ddc 3.5.0 (from repo), and trunk (3.6) - all of them have this bug.
      I've found that the error is thrown since d12d2d496540c698f30e9b528b66e8f6636842d3, which is included in 3.0 beta 1 (but not in the alpha 1).
      Cassandra 3.0 alpha 1 does not throw the error, but forgets about the changes after shutting down.

      Only after rm ./data/commitlog/* , Cassandra starts fine.
      By the way, map<int, boolean> works fine.

      Steps to reproduce:

      $ ant build
      $ ./bin/cassandra
      $ ./bin/cqlsh
      
      CREATE KEYSPACE bugs
          WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}
          AND durable_writes = true;
      
      CREATE TABLE bugs.bug1 (
          id int,
          m  map<int, tinyint or smallint>, -- key can be any type
          PRIMARY KEY (id)
      );
      
      INSERT INTO bugs.bug1 (id, m) VALUES (1, {0: 4, 4: 3});
      
      UPDATE bugs.bug1 SET m[0]=NULL WHERE id=1;
      -- and/or UPDATE bugs.bug1 SET m[1]=NULL WHERE id=1;
      
      SELECT * FROM bugs.bug1;
      
       id | m
      ----+--------
        1 | {4: 3}
      
      (1 rows)
      
      $ ./bin/nodetool stopdaemon
      $ ./bin/cassandra
      

      Attachments

        Activity

          People

            slebresne Sylvain Lebresne
            arzeth Artem Chudinov
            Sylvain Lebresne
            Benjamin Lerer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: