Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4003

Cassandra: Error 1032 (Can't find record) on concurrent delete from the same storage through different tables

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 10.0.1
    • 10.0.11
    • None

    Description

      Two connections run DELETE from different Cassandra tables which point at the same column family. One DELETE ends with error 1032 "Can't find record".

      DROP TABLE iF EXISTS t1, t2;
      CREATE TABLE t1 (
      pk int primary key,
      c1 varchar(256),
      c2 varchar(32)
      ) ENGINE=Cassandra keyspace='bug' column_family='cf1' thrift_host='127.0.0.1';
      CREATE TABLE t2 LIKE t1;
      INSERT INTO t1 VALUES (1,'a','b'), (2,NULL,'c'), (3,'s','d');
      DELETE FROM t1 WHERE pk BETWEEN 1 AND 6;
      DELETE FROM t2 WHERE c2 IN ('f',  0 ) ORDER BY pk;
      main.t14                                 [ fail ]
              Test ended at 2013-01-06 02:17:29
       
      CURRENT_TEST: main.t14
      mysqltest: At line 42: query 'DELETE FROM t2 WHERE c2 IN ('f',  0 ) ORDER BY pk' failed: 1032: Can't find record in 't2'

      ORDER BY in the DELETE seems to be important.

      Run the test below with repeat, e.g.

      perl mysql-test-run.pl --repeat=30 <test name>

      --source include/have_cassandra.inc
       
      --disable_warnings
      DROP TABLE iF EXISTS t1, t2;
      --enable_warnings
       
      --remove_files_wildcard $MYSQLTEST_VARDIR cassandra_test_cleanup.cql
      --write_file $MYSQLTEST_VARDIR/cassandra_test_cleanup.cql
      drop keyspace bug;
      EOF
      --error 0,1,2
      --system cqlsh -3 -f $MYSQLTEST_VARDIR/cassandra_test_cleanup.cql
       
      --remove_files_wildcard $MYSQLTEST_VARDIR cassandra_test_init.cql
      --write_file $MYSQLTEST_VARDIR/cassandra_test_init.cql
       
      CREATE KEYSPACE bug
        WITH strategy_class = 'org.apache.cassandra.locator.SimpleStrategy'
        AND strategy_options:replication_factor='1';
       
      USE bug;
      create columnfamily cf1 ( pk int primary key, c1 ascii, c2 ascii );
      EOF
       
      --system cqlsh -3 -f $MYSQLTEST_VARDIR/cassandra_test_init.cql
       
      CREATE TABLE t1 (
       pk int primary key,
       c1 varchar(256),
       c2 varchar(32)
      ) ENGINE=Cassandra keyspace='bug' column_family='cf1' thrift_host='127.0.0.1';
       
      CREATE TABLE t2 LIKE t1;
       
      INSERT INTO t1 VALUES (1,'a','b'), (2,NULL,'c'), (3,'s','d');
       
      --connect (con1,localhost,root,,test)
      --send 
      DELETE FROM t1 WHERE pk BETWEEN 1 AND 6;
       
      --connection default
      DELETE FROM t2 WHERE c2 IN ('f',  0 ) ORDER BY pk;
       
      --connection con1
      --reap
       
      DROP TABLE t1, t2;
      --disconnect con1
       

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.