Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-3841 LevelDB storage engine
  3. MDEV-3958

Assertion `kdef' fails in Primary_key_comparator::Compare on inserting data into a table previously altered and converted into LevelDB

    Details

    • Type: Technical task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      CREATE TABLE t1 (a INT(11), b CHAR(8)) ENGINE=MyISAM;
      ALTER TABLE t1 ADD PRIMARY KEY (a);
      ALTER TABLE t1 ENGINE=LevelDB;
      INSERT INTO t1 VALUES (1,'a'),(2,'b');
      
      #9  0xb738f167 in __assert_fail () from /lib/libc.so.6
      #10 0x0891d799 in Primary_key_comparator::Compare (this=0x90951b0 <primary_key_comparator>, a=..., b=...) at mysql-5.6-leveldb/storage/leveldb/ha_leveldb.cc:148
      #11 0xb769cd88 in leveldb::InternalKeyComparator::Compare(leveldb::Slice const&, leveldb::Slice const&) const () from leveldb-1.7.0/libleveldb.so.1
      #12 0xb76ab7fc in leveldb::MemTable::KeyComparator::operator()(char const*, char const*) const () from leveldb-1.7.0/libleveldb.so.1
      #13 0xb76abf55 in leveldb::SkipList<char const*, leveldb::MemTable::KeyComparator>::FindGreaterOrEqual(char const* const&, leveldb::SkipList<char const*, leveldb::MemTable::KeyComparator>::Node**) const () from leveldb-1.7.0/libleveldb.so.1
      #14 0xb76ac083 in leveldb::SkipList<char const*, leveldb::MemTable::KeyComparator>::Insert(char const* const&) () from leveldb-1.7.0/libleveldb.so.1
      #15 0xb76ab9d9 in leveldb::MemTable::Add(unsigned long long, leveldb::ValueType, leveldb::Slice const&, leveldb::Slice const&) () from leveldb-1.7.0/libleveldb.so.1
      #16 0xb76bb8cb in leveldb::(anonymous namespace)::MemTableInserter::Put(leveldb::Slice const&, leveldb::Slice const&) () from leveldb-1.7.0/libleveldb.so.1
      #17 0xb76bbca8 in leveldb::WriteBatch::Iterate(leveldb::WriteBatch::Handler*) const () from leveldb-1.7.0/libleveldb.so.1
      #18 0xb76bbf84 in leveldb::WriteBatchInternal::InsertInto(leveldb::WriteBatch const*, leveldb::MemTable*) () from leveldb-1.7.0/libleveldb.so.1
      
      revision-id: psergey@askmonty.org-20121221152341-9stvnkuiinslrt9h
      date: 2012-12-21 19:23:41 +0400
      build-date: 2012-12-22 02:09:59 +0400
      revno: 4471
      branch: mysql-5.6-leveldb
      

      LevelDB version 1.7.0.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            This looks fixed in revno 4471.

            Show
            elenst Elena Stepanova added a comment - This looks fixed in revno 4471.
            Hide
            psergey Sergei Petrunia added a comment -

            The crash no longer happens, but the data is not there after ALTER TABLE:

            MySQL [ldb5]> create table t3 (i int primary key) engine = myisam;
            Query OK, 0 rows affected (0.05 sec)

            MySQL [ldb5]> insert into t3 values (1);
            Query OK, 1 row affected (0.00 sec)

            MySQL [ldb5]> insert into t3 values (2);
            Query OK, 1 row affected (0.00 sec)

            MySQL [ldb5]> alter table t3 engine=leveldb;
            Query OK, 2 rows affected (0.05 sec)
            Records: 2 Duplicates: 0 Warnings: 0

            MySQL [ldb5]> select * from t3;
            Empty set (0.00 sec)

            Show
            psergey Sergei Petrunia added a comment - The crash no longer happens, but the data is not there after ALTER TABLE: MySQL [ldb5] > create table t3 (i int primary key) engine = myisam; Query OK, 0 rows affected (0.05 sec) MySQL [ldb5] > insert into t3 values (1); Query OK, 1 row affected (0.00 sec) MySQL [ldb5] > insert into t3 values (2); Query OK, 1 row affected (0.00 sec) MySQL [ldb5] > alter table t3 engine=leveldb; Query OK, 2 rows affected (0.05 sec) Records: 2 Duplicates: 0 Warnings: 0 MySQL [ldb5] > select * from t3; Empty set (0.00 sec)
            Hide
            elenst Elena Stepanova added a comment -

            The initial test case was just altering the engine, it failed on revno 4467, but passed on 4471.
            I changed the test case to one which fails on 4471 too.

            Show
            elenst Elena Stepanova added a comment - The initial test case was just altering the engine, it failed on revno 4467, but passed on 4471. I changed the test case to one which fails on 4471 too.
            Hide
            psergey Sergei Petrunia added a comment -

            Ok, ALTER TABLE relied on the engine supporting table renames, which we dont' support yet (see today's email). This can cause the table to look at the data from the other table, which results in assert (when seeing other table data), or in empty tables (when not seeing one's own data). Disabled all ALTER TABLE commands for now.

            Show
            psergey Sergei Petrunia added a comment - Ok, ALTER TABLE relied on the engine supporting table renames, which we dont' support yet (see today's email). This can cause the table to look at the data from the other table, which results in assert (when seeing other table data), or in empty tables (when not seeing one's own data). Disabled all ALTER TABLE commands for now.
            Hide
            psergey Sergei Petrunia added a comment -

            Fixed by fix for MDEV-3959.

            Show
            psergey Sergei Petrunia added a comment - Fixed by fix for MDEV-3959 .

              People

              • Assignee:
                psergey Sergei Petrunia
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 10 minutes
                  10m