Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion `dd_val >= last_val' failed in myrocks::ha_rocksdb::load_auto_incr_value_from_index #869

Closed
spetrunia opened this issue Aug 13, 2018 · 2 comments
Assignees

Comments

@spetrunia
Copy link
Contributor

This is originally from MDEV-16703:

MyRocks doesn't update AUTO_INCREMENT value for UPDATEs that change the value of the primary key.
One of the consequences is that running these statements causes an assertion failure:

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3;
ALTER TABLE t1 AUTO_INCREMENT 2;

``
Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff425b700 (LWP 8547)]
0x00007ffff5a94267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
55 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) wher
#0 0x00007ffff5a94267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#1 0x00007ffff5a95eca in __GI_abort () at abort.c:89
#2 0x00007ffff5a8d03d in __assert_fail_base (fmt=0x7ffff5bef028 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x1fd0228 "dd_val >= last_val", file=file@entry=0x1fcb7a0 "/home/psergey/dev-git/mysql-5.6-rocksdb-look800/storage/rocksdb/ha_rocksdb.cc", line=line@entry=5276, function=function@entry=0x1fd5880 myrocks::ha_rocksdb::load_auto_incr_value_from_index()::__PRETTY_FUNCTION__ "ulonglong myrocks::ha_rocksdb::load_auto_incr_value_from_index()") at assert.c:92
#3 0x00007ffff5a8d0f2 in __GI___assert_fail (assertion=0x1fd0228 "dd_val >= last_val", file=0x1fcb7a0 "/home/psergey/dev-git/mysql-5.6-rocksdb-look800/storage/rocksdb/ha_rocksdb.cc", line=5276, function=0x1fd5880 myrocks::ha_rocksdb::load_auto_incr_value_from_index()::__PRETTY_FUNCTION__ "ulonglong myrocks::ha_rocksdb::load_auto_incr_value_from_index()") at assert.c:101
#4 0x0000000001762dbc in myrocks::ha_rocksdb::load_auto_incr_value_from_index (this=0x7fffe00213d0) at /home/psergey/dev-git/mysql-5.6-rocksdb-look800/storage/rocksdb/ha_rocksdb.cc:5276
#5 0x0000000001778a2a in myrocks::ha_rocksdb::prepare_inplace_alter_table (this=0x7fffe00213d0, altered_table=0x7fffe00237e0, ha_alter_info=0x7ffff4256a80) at /home/psergey/dev-git/mysql-5.6-rocksdb-look800/storage/rocksdb/ha_rocksdb.cc:11692
#6 0x0000000000e9ff5f in handler::ha_prepare_inplace_alter_table (this=0x7fffe00213d0, altered_table=0x7fffe00237e0, ha_alter_info=0x7ffff4256a80) at /home/psergey/dev-git/mysql-5.6-rocksdb-look800/sql/handler.cc:4862
#7 0x0000000001157545 in mysql_inplace_alter_table (thd=0x2e71090, table_list=0x7fffe0005720, table=0x7fffe0020a70, altered_table=0x7fffe00237e0, ha_alter_info=0x7ffff4256a80, inplace_supported=HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE, target_mdl_request=0x7ffff4256af0, alter_ctx=0x7ffff4257210) at /home/psergey/dev-git/mysql-5.6-rocksdb-look800/sql/sql_table.cc:6779
#8 0x000000000115cd83 in mysql_alter_table (thd=0x2e71090, new_db=0x7fffe0005c88 "test", new_name=0x0, create_info=0x7ffff4258280, table_list=0x7fffe0005720, alter_info=0x7ffff42581a0, order_num=0, order=0x0, ignore=false) at /home/psergey/dev-git/mysql-5.6-rocksdb-look800/sql/sql_table.cc:8957
#9 0x00000000012c5090 in Sql_cmd_alter_table::execute (this=0x7fffe0005c98, thd=0x2e71090) at /home/psergey/dev-git/mysql-5.6-rocksdb-look800/sql/sql_alter.cc:335
#10 0x00000000010cde84 in mysql_execute_command (thd=0x2e71090, statement_start_time=0x7ffff4259a98, post_parse=0x7ffff4259be8) at /home/psergey/dev-git/mysql-5.6-rocksdb-look800/sql/sql_parse.cc:6209
#11 0x00000000010d1ff1 in mysql_parse (thd=0x2e71090, rawbuf=0x7fffe0005630 "ALTER TABLE t1 AUTO_INCREMENT 2", length=31, parser_state=0x7ffff425a4e0, last_timer=0x7ffff4259be8, async_commit=0x7ffff4259bb3 "") at /home/psergey/dev-git/mysql-5.6-rocksdb-look800/sql/sql_parse.cc:7895
#12 0x00000000010c232d in dispatch_command (command=COM_QUERY, thd=0x2e71090, packet=0x2e83a81 "ALTER TABLE t1 AUTO_INCREMENT 2", packet_length=31) at /home/psergey/dev-git/mysql-5.6-rocksdb-look800/sql/sql_parse.cc:1919


There is a patch for this in the works.
@spetrunia
Copy link
Contributor Author

spetrunia commented Aug 13, 2018

Oh, there is a PR already filed for this: #868
(CC'ing @minggr so he's aware this issue is filed too)

@lth
Copy link
Contributor

lth commented Aug 16, 2018

#868

@lth lth closed this as completed Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants