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

mysqld some times crashes at the end of Random Query Generator test #111

Closed
mariadb-DanielLee opened this issue Nov 25, 2015 · 22 comments
Closed
Assignees

Comments

@mariadb-DanielLee
Copy link

nodes: Single server, no replication
partition support: disabled

I executed the RQG sample test 5 times. For 2 of them, mysqld crashed at the end of the tests.

RQG test command:

perl gentest.pl --dsn=dbi:mysql:host=localhost:port=3306:user=root:database=test:mysql_socket=/tmp/mysql.sock --gendata=conf/examples/example.zz --grammar=conf/examples/example.yy --threads=10 --queries=10000

Terminal output:
.
.
.
#2015-11-25T11:28:04 [2538] Killing remaining worker process with pid 2553...
#2015-11-25T11:28:04 [2555] Mixer: Server crash or critical failure (STATUS_SERVER_CRASHED) reported at dsn dbi:mysql:host=localhost:port=3306:user=root:database=test:mysql_socket=/tmp/mysql.sock
#2015-11-25T11:28:04 [2538] Killing remaining worker process with pid 2546...
#2015-11-25T11:28:04 [2538] Killing remaining worker process with pid 2555...
#2015-11-25T11:28:04 [2538] Killing remaining worker process with pid 2547...
#2015-11-25T11:28:05 [2538] Killing periodic reporting process with pid 2545...
#2015-11-25T11:28:05 [2545] GenTest: child is being stopped with status STATUS_OK
#2015-11-25T11:28:05 [2538] For pid 2545 reporter status STATUS_OK
#2015-11-25T11:28:05 [2538] Kill GenTest::ErrorFilter(2544)
#2015-11-25T11:28:05 [2538] Server crash reported, initiating post-crash analysis...
#2015-11-25T11:28:05 [2538] datadir is /home/myrocks/builds/mytest/install.db/
#2015-11-25T11:28:05 [2538] binary is
#2015-11-25T11:28:05 [2538] bindir is
#2015-11-25T11:28:05 [2538] WARNING: Core file not found!

: No such file or directory.
"/home/myrocks/mariadb-patches" is not a core dump: Is a directory
backtrace.gdb:19: Error in sourced command file:
No stack.
#2015-11-25T11:28:05 [2538]

: No such file or directory.
"/home/myrocks/mariadb-patches" is not a core dump: Is a directory
#2015-11-25T11:28:05 [2538]
#2015-11-25T11:28:05 [2538] Test completed with failure status STATUS_SERVER_CRASHED (101)

myrocks@rocksdb:~/mariadb-patches$

mysqld output for failed test #1:

rocksdb.number.keys.read COUNT : 794851
rocksdb.number.keys.updated COUNT : 0
rocksdb.bytes.written COUNT : 5927602
rocksdb.bytes.read COUNT : 39486267
rocksdb.num
mysqld: /home/myrocks/builds/mytest/mysql-5.6/sql/sql_error.cc:432: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `! is_set()' failed.

mysqld output for failed test #2:

2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,651)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,652)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,653)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,654)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,655)
mysqld: /home/myrocks/builds/mytest/mysql-5.6/sql/sql_error.cc:432: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `! is_set()' failed.

@yoshinorim
Copy link
Contributor

Could you paste whole stack trace?

@mariadb-DanielLee
Copy link
Author

Trace #1

myrocks@rocksdb:/builds/mytest$ /home/qa/myr/common/sh/startmysqld.sh mytest
Module: startmysql.sh TestDir=/home/myrocks/builds/mytest
myrocks@rocksdb:
/builds/mytest$ [Note] Global variable initial value (from config file) @@datadir = '/home/myrocks/builds/mytest/install.db'
[Note] Global variable initial value (from config file) @@language = './share/english'
2015-11-25 11:25:48 0 [Warning] The syntax '--language/-l' is deprecated and will be removed in a future release. Please use '--lc-messages-dir' instead.
[Note] Global variable initial value (from config file) @@default-storage-engine = 'rocksdb'
[Note] Global variable initial value (from config file) @@default-tmp-storage-engine = 'MyISAM'
2015-11-25 11:25:48 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-25 11:25:48 0 [Note] ./mysqld (mysqld 5.6.24-debug) starting as process 2528 ...
2015-11-25 11:25:48 2528 [Warning] Using pre 5.5 semantics to load error messages from /home/myrocks/builds/mytest/mysql-5.6/sql/share/english/.
2015-11-25 11:25:48 2528 [Warning] If this is not intended, refer to the documentation for valid usage of --lc-messages-dir and --language parameters.
2015-11-25 11:25:48 2528 [Note] Flashcache bypass: disabled
2015-11-25 11:25:48 2528 [Note] Flashcache setup error is : open flash device failed

2015-11-25 11:25:48 2528 [Note] Plugin 'FEDERATED' is disabled.
2015-11-25 11:25:48 2528 [Warning] The option innodb (skip-innodb) is deprecated and will be removed in a future release
2015-11-25 11:25:48 2528 [Note] Plugin 'InnoDB' is disabled.
2015-11-25 11:25:48 2528 [Note] RocksDB: Got ENOENT when listing column families
2015-11-25 11:25:48 2528 [Note] RocksDB: assuming that we're creating a new database
2015-11-25 11:25:48 2528 [Note] RocksDB: Column Families at start:
2015-11-25 11:25:48 2528 [Note] cf=default
2015-11-25 11:25:48 2528 [Note] write_buffer_size=4194304
2015-11-25 11:25:48 2528 [Note] target_file_size_base=2097152
2015-11-25 11:25:48 2528 [Note] RocksDB: creating column family system
2015-11-25 11:25:48 2528 [Note] write_buffer_size=4194304
2015-11-25 11:25:48 2528 [Note] target_file_size_base=2097152
2015-11-25 11:25:48 2528 [Note] RocksDB: Table_store: loaded DDL data for 0 tables
2015-11-25 11:25:48 2528 [Note] RocksDB instance opened
2015-11-25 11:25:48 2528 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 91adb44d-9399-11e5-9000-000c2907e773.
2015-11-25 11:25:48 2528 [Note] RSA private key file not found: /home/myrocks/builds/mytest/install.db//private_key.pem. Some authentication plugins will not work.
2015-11-25 11:25:48 2528 [Note] RSA public key file not found: /home/myrocks/builds/mytest/install.db//public_key.pem. Some authentication plugins will not work.
2015-11-25 11:25:48 2528 [Note] Server hostname (bind-address): ''; port: 3306
2015-11-25 11:25:48 2528 [Note] IPv6 is available.
2015-11-25 11:25:48 2528 [Note] - '::' resolves to '::';
2015-11-25 11:25:48 2528 [Note] Server socket created on IP: '::'.
2015-11-25 11:25:48 2528 [Note] Event Scheduler: Loaded 0 events
2015-11-25 11:25:48 2528 [Note] ./mysqld: ready for connections.
Version: '5.6.24-debug' socket: '/tmp/mysql.sock' port: 3306 Source distribution
2015-11-25 11:27:48 2528 [Note] LibRocksDB:------- DUMPING STATS -------
2015-11-25 11:27:48 2528 [Note] LibRocksDB:
*
Compaction Stats [default] **

Level Files Size(MB) Score Read(GB) Rn(GB) Rnp1(GB) Write(GB) Wnew(GB) Moved(GB) W-Amp Rd(MB/s) Wr(MB/s) Comp(sec) Comp(cnt) Avg(sec) Stall(cnt) KeyIn KeyDrop

L0 4/0 1.68 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.0 1 4 0.208 0 0 0
Sum 4/0 1.68 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 2.0 1 4 0.208 0 0 0
Int 0/0 0.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 2.0 1 4 0.208 0 0 0
Flush(GB): cumulative 0.002, interval 0.002
Stalls(count): 0 level0_slowdown, 0 level0_slowdown_with_compaction, 0 level0_numfiles, 0 level0_numfiles_w
2015-11-25 11:27:48 2528 [Note] LibRocksDB:STATISTICS:
rocksdb.block.cache.miss COUNT : 286
rocksdb.block.cache.hit COUNT : 367227
rocksdb.block.cache.add COUNT : 286
rocksdb.block.cache.index.miss COUNT : 4
rocksdb.block.cache.index.hit COUNT : 165571
rocksdb.block.cache.filter.miss COUNT : 0
rocksdb.block.cache.filter.hit COUNT : 0
rocksdb.block.cache.data.miss COUNT : 282
rocksdb.block.cache.data.hit COUNT : 201656
rocksdb.block.cache.bytes.read COUNT : 1292069525
rocksdb.block.cache.bytes.write COUNT : 1155397
rocksdb.bloom.filter.useful COUNT : 0
rocksdb.memtable.hit COUNT : 677525
rocksdb.memtable.miss COUNT : 117324
rocksdb.l0.hit COUNT : 109033
rocksdb.l1.hit COUNT : 0
rocksdb.l2andup.hit COUNT : 0
rocksdb.compaction.key.drop.new COUNT : 0
rocksdb.compaction.key.drop.obsolete COUNT : 0
rocksdb.compaction.key.drop.user COUNT : 0
rocksdb.number.keys.written COUNT : 408056
rocksdb.number.keys.read COUNT : 794851
rocksdb.number.keys.updated COUNT : 0
rocksdb.bytes.written COUNT : 5927602
rocksdb.bytes.read COUNT : 39486267
rocksdb.num
mysqld: /home/myrocks/builds/mytest/mysql-5.6/sql/sql_error.cc:432: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `! is_set()' failed.

Trace #2,

The top portion is from successful tests prior to the failed test

2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,456)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,457)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,458)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,459)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,460)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,461)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,462)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,463)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,464)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,465)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,466)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,467)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,468)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,469)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,470)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,471)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,472)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,473)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,474)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,475)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,476)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,477)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,478)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,479)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,480)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,481)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,482)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,483)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,484)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,485)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,486)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,487)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,488)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,489)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,490)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,491)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,492)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,493)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,494)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,495)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,496)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,497)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,498)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,499)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,500)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,501)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,502)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,503)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,504)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,505)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,506)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,507)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,508)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,509)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,510)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,511)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,512)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,513)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,514)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,515)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,516)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,517)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,518)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,519)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,520)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,521)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,522)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,523)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,524)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,525)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,526)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,527)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,528)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,529)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,530)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,531)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,532)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,533)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,534)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,535)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,536)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,537)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,538)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,539)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,540)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,541)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,542)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,543)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,544)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,545)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,546)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,547)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,548)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,549)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,550)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,551)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,552)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,553)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,554)
2015-11-25 11:53:27 2598 [Note] RocksDB: Begin filtering dropped index (0,555)
2015-11-25 11:57:10 2598 [Note] LibRocksDB:------- DUMPING STATS -------
2015-11-25 11:57:10 2598 [Note] LibRocksDB:
** Compaction Stats [default] **

Level Files Size(MB) Score Read(GB) Rn(GB) Rnp1(GB) Write(GB) Wnew(GB) Moved(GB) W-Amp Rd(MB/s) Wr(MB/s) Comp(sec) Comp(cnt) Avg(sec) Stall(cnt) KeyIn KeyDrop

L0 4/0 2.80 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.2 8 45 0.185 0 0 0
L1 2/0 1.24 0.1 0.0 0.0 0.0 0.0 0.0 0.0 0.3 11.3 2.4 3 11 0.235 0 2140K 915K
Sum 6/0 4.04 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.2 2.7 3.0 11 56 0.194 0 2140K 915K
Int 0/0 0.00 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.3 2.9 3.2 6 30 0.199 0
2015-11-25 11:57:10 2598 [Note] LibRocksDB:STATISTICS:
rocksdb.block.cache.miss COUNT : 8267
rocksdb.block.cache.hit COUNT : 8519680
rocksdb.block.cache.add COUNT : 6170
rocksdb.block.cache.index.miss COUNT : 59
rocksdb.block.cache.index.hit COUNT : 3937243
rocksdb.block.cache.filter.miss COUNT : 0
rocksdb.block.cache.filter.hit COUNT : 0
rocksdb.block.cache.data.miss COUNT : 8208
rocksdb.block.cache.data.hit COUNT : 4582437
rocksdb.block.cache.bytes.read COUNT : 36608862819
rocksdb.block.cache.bytes.write COUNT : 25072136
rocksdb.bloom.filter.useful COUNT : 0
rocksdb.memtable.hit COUNT : 8514906
rocksdb.memtable.miss COUNT : 3065224
rocksdb.l0.hit COUNT : 2272401
rocksdb.l1.hit COUNT : 705111
rocksdb.l2andup.hit COUNT : 0
rocksdb.compaction.key.drop.new COUNT : 838533
rocksdb.compaction.key.drop.obsolete COUNT : 881307
rocksdb.compaction.key.drop.user COUNT : 0
rocksdb.number.keys.written COUNT : 4465048
rocksdb.number.keys.read COUNT : 11580130
rocksdb.number.keys.updated COUNT : 0
rocksdb.bytes.written COUNT : 64669173
rocksdb.bytes.re
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,556)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,557)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,558)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,559)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,560)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,561)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,562)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,563)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,564)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,565)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,566)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,567)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,568)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,569)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,570)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,571)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,572)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,573)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,574)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,575)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,576)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,577)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,578)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,579)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,580)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,581)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,582)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,583)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,584)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,585)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,586)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,587)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,588)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,589)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,590)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,591)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,592)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,593)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,594)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,595)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,596)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,597)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,598)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,599)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,600)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,601)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,602)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,603)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,604)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,605)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,606)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,607)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,608)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,609)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,610)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,611)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,612)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,613)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,614)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,615)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,616)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,617)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,618)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,619)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,620)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,621)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,622)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,623)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,624)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,625)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,626)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,627)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,628)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,629)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,630)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,631)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,632)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,633)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,634)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,635)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,636)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,637)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,638)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,639)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,640)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,641)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,642)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,643)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,644)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,645)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,646)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,647)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,648)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,649)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,650)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,651)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,652)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,653)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,654)
2015-11-25 12:00:07 2598 [Note] RocksDB: Begin filtering dropped index (0,655)
mysqld: /home/myrocks/builds/mytest/mysql-5.6/sql/sql_error.cc:432: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `! is_set()' failed.

@yoshinorim
Copy link
Contributor

@dleeyh It's error log, but what I wanted to look into was process stack trace (at assertion failure). Wasn't it printed in the error log? If not, could you enable core-file in my.cnf then get stack trace from core files?

@yoshinorim
Copy link
Contributor

@dleeyh I couldn't reproduce. Could you paste my.cnf options?

@mariadb-DanielLee
Copy link
Author

Here is my .cnf file:

[mysqld]
datadir=/home/myrocks/builds/mytest/install.db
socket=/tmp/mysql.sock
gdb
language=./share/english
default-storage-engine=rocksdb
skip-innodb
default-tmp-storage-engine=MyISAM
rocksdb

How do you enable mysqld logging? I tried few different methods according to online resources and still not getting log files.

@yoshinorim
Copy link
Contributor

Thanks!

About saving core files, add "core-file" in my.cnf. After crash, core file should be written at /var/tmp/cores. Then run "gdb /path/to/mysqld /path/to/core_file" then run "bt". -- https://dev.mysql.com/doc/refman/5.6/en/using-gdb-on-mysqld.html

@yoshinorim
Copy link
Contributor

Also, if you have not updated MyRocks, would you please git pull then rebuild (and disable partition to prevent crash -- until Sergey commits his diff)?

@mariadb-DanielLee
Copy link
Author

Got the latest MyRocks today. The first 4 tests were successful. The 5th test failed due to the same Assertion.

@mariadb-DanielLee
Copy link
Author

myrocks@rocksdb:/home/qa/myr/bugs/111$ gdb /home/myrocks/builds/nightly/mysql-5.6/sql/mysqld core
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/myrocks/builds/nightly/mysql-5.6/sql/mysqld...done.
[New LWP 35107]
[New LWP 35109]
[New LWP 35161]
[New LWP 35081]
[New LWP 35085]
[New LWP 35101]
[New LWP 35097]
[New LWP 35115]
[New LWP 35250]
[New LWP 35091]
[New LWP 35103]
[New LWP 35084]
[New LWP 35083]
[New LWP 35082]
[New LWP 35206]
[New LWP 35113]
[New LWP 35117]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by ./mysqld --defaults-file=/home/myrocks/builds/nightly/nightly.cnf --rocksdb_str'. Program terminated with signal SIGABRT, Aborted. #0 0x00007f727a382cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. Traceback (most recent call last): File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module> from libstdcxx.v6.printers import register_libstdcxx_printers ImportError: No module named 'libstdcxx' (gdb) bt #0 0x00007f727a382cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x00007f727a3860d8 in __GI_abort () at abort.c:89 #2 0x00007f727a37bb86 in __assert_fail_base (fmt=0x7f727a4cc830 "%s%s%s:%u: %s%sAssertion%s' failed.\n%n",
assertion=assertion@entry=0x154c386 "! is_set()",
file=file@entry=0x154c1a0 "/home/myrocks/builds/nightly/mysql-5.6/sql/sql_error.cc", line=line@entry=432,
function=function@entry=0x154c800 <Diagnostics_area::set_ok_status(unsigned long long, unsigned long long, char const*)::PRETTY_FUNCTION> "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char_)")
at assert.c:92
#3 0x00007f727a37bc32 in _GI___assert_fail (assertion=0x154c386 "! is_set()",
file=0x154c1a0 "/home/myrocks/builds/nightly/mysql-5.6/sql/sql_error.cc", line=432,
function=0x154c800 <Diagnostics_area::set_ok_status(unsigned long long, unsigned long long, char const
)::PRETTY_FUNCTION> "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:101
#4 0x0000000000ae5f30 in Diagnostics_area::set_ok_status (this=0x3d2aec8, affected_rows=1, last_insert_id=0,
message=0x7f725bf59f20 "Rows matched: 1 Changed: 1 Warnings: 1")
at /home/myrocks/builds/nightly/mysql-5.6/sql/sql_error.cc:432
#5 0x0000000000aa16ae in my_ok (thd=0x3d26910, affected_rows=1, id=0,
message=0x7f725bf59f20 "Rows matched: 1 Changed: 1 Warnings: 1")
at /home/myrocks/builds/nightly/mysql-5.6/sql/sql_class.h:4528
#6 0x0000000000bb3670 in mysql_update (thd=0x3d26910, table_list=0x7f725006c3e8, fields=..., values=..., conds=
0x7f725006ceb0, order_num=0, order=0x0, limit=2, handle_duplicates=DUP_ERROR, ignore=false,
found_return=0x7f725bf5a3a0, updated_return=0x7f725bf5a480)
at /home/myrocks/builds/nightly/mysql-5.6/sql/sql_update.cc:1014
#7 0x0000000000b1b96d in mysql_execute_command (thd=0x3d26910, statement_start_time=0x7f725bf5b6a0,
post_parse=0x7f725bf5b810) at /home/myrocks/builds/nightly/mysql-5.6/sql/sql_parse.cc:3923
#8 0x0000000000b24449 in mysql_parse (thd=0x3d26910,
rawbuf=0x7f725006c1f0 "UPDATE table1_int_autoinc SET col_set_utf8_key_default_null = 0 WHERE col_enum_utf8_key_default_null = 3 LIMIT 3", length=118, parser_state=0x7f725bf5c050, last_timer=0x7f725bf5b810,
async_commit=0x7f725bf5b7e8 "") at /home/myrocks/builds/nightly/mysql-5.6/sql/sql_parse.cc:7233
#9 0x0000000000b15f8d in dispatch_command (command=COM_QUERY, thd=0x3d26910,
packet=0x3d0f7a1 "UPDATE table1_int_autoinc SET col_set_utf8_key_default_null = 0 WHERE col_enum_utf8_key_default_null = 3 LIMIT 3", packet_length=118) at /home/myrocks/builds/nightly/mysql-5.6/sql/sql_parse.cc:1595
#10 0x0000000000b148bf in do_command (thd=0x3d26910)
at /home/myrocks/builds/nightly/mysql-5.6/sql/sql_parse.cc:1071
#11 0x0000000000adb292 in do_handle_one_connection (thd_arg=0x3d0aa10)
at /home/myrocks/builds/nightly/mysql-5.6/sql/sql_connect.cc:1071
#12 0x0000000000adabbe in handle_one_connection (arg=0x3d0aa10)
at /home/myrocks/builds/nightly/mysql-5.6/sql/sql_connect.cc:929
#13 0x00007f727af39182 in start_thread (arg=0x7f725bf5d700) at pthread_create.c:312
#14 0x00007f727a44647d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb)

@mariadb-DanielLee
Copy link
Author

Are you able to reproduce the issue with information that I provided?

Thanks

@yoshinorim
Copy link
Contributor

No I couldn't reproduce. I'm not sure if it is caused by MyRocks or not. Could you also test with InnoDB then see if it reproduces?

@mariadb-DanielLee
Copy link
Author

Ran the same test 7 times on InnoDB. All completed without crashing.

@hermanlee
Copy link
Contributor

I haven't been able to reproduce the problem with the gentest.pl file that comes with MySQL. I've downloaded the one from http://bazaar.launchpad.net/~elenst/randgen/mariadb-patches/revision/1050 but have trouble with the generator on my system. Which gentest.pl are you using for the test?

Based the stack trace of the error, it looks like the Update statement is trying to execute set_ok_status() after it succeeded, but that's failing possibly because some prior status was already set. Looking through the myrocks code, I don't see where we maybe setting the status directly. Since it looks like there is 1 warning in the return, is it possible the status could have been set by whatever triggered the warning?

@spetrunia
Copy link
Contributor

I was able to reproduce, and generated a core file.

Program terminated with signal SIGABRT, Aborted.
(gdb) wher
  #0  0x00007f7343bf2f79 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
  #1  0x00007f7343bf6388 in __GI_abort () at abort.c:89
  #2  0x00007f7343bebe36 in __assert_fail_base (fmt=0x7f7343d3d718 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x154cf26 "! is_set()", file=file@entry=0x154cd38 "/home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_error.cc", line=line@entry=432, function=function@entry=0x154d3a0 <Diagnostics_area::set_ok_status(unsigned long long, unsigned long long, char const*)::__PRETTY_FUNCTION__> "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:92
  #3  0x00007f7343bebee2 in __GI___assert_fail (assertion=0x154cf26 "! is_set()", file=0x154cd38 "/home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_error.cc", line=432, function=0x154d3a0 <Diagnostics_area::set_ok_status(unsigned long long, unsigned long long, char const*)::__PRETTY_FUNCTION__> "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:101
  #4  0x0000000000ae62da in Diagnostics_area::set_ok_status (this=0x2d9d4e8, affected_rows=1, last_insert_id=0, message=0x7f7345d70f20 "Rows matched: 1  Changed: 1  Warnings: 1") at /home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_error.cc:432
  #5  0x0000000000aa1ab6 in my_ok (thd=0x2d98f30, affected_rows=1, id=0, message=0x7f7345d70f20 "Rows matched: 1  Changed: 1  Warnings: 1") at /home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_class.h:4528
  #6  0x0000000000bb39ba in mysql_update (thd=0x2d98f30, table_list=0x7f73240071f0, fields=..., values=..., conds=0x7f7324007c70, order_num=0, order=0x0, limit=5, handle_duplicates=DUP_ERROR, ignore=false, found_return=0x7f7345d713a0, updated_return=0x7f7345d71480) at /home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_update.cc:1014
  #7  0x0000000000b1bd1d in mysql_execute_command (thd=0x2d98f30, statement_start_time=0x7f7345d726a0, post_parse=0x7f7345d72810) at /home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_parse.cc:3923
  #8  0x0000000000b247f9 in mysql_parse (thd=0x2d98f30, rawbuf=0x7f7324006fb0 "UPDATE `table1_key_pk_parts_2_int_autoinc` SET `col_set_latin1_not_null_key` = 7 WHERE `col_int_key` < 9 LIMIT 6", length=112, parser_state=0x7f7345d73050, last_timer=0x7f7345d72810, async_commit=0x7f7345d727e8 "") at /home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_parse.cc:7233
  #9  0x0000000000b1633d in dispatch_command (command=COM_QUERY, thd=0x2d98f30, packet=0x2d9e2e1 "UPDATE `table1_key_pk_parts_2_int_autoinc` SET `col_set_latin1_not_null_key` = 7 WHERE `col_int_key` < 9 LIMIT 6", packet_length=112) at /home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_parse.cc:1595
  #10 0x0000000000b14c6f in do_command (thd=0x2d98f30) at /home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_parse.cc:1071
  #11 0x0000000000adb69a in do_handle_one_connection (thd_arg=0x2d98f30) at /home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_connect.cc:1071
  #12 0x0000000000adafc6 in handle_one_connection (arg=0x2d98f30) at /home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_connect.cc:929
  #13 0x00007f73447aa182 in start_thread (arg=0x7f7345d74700) at pthread_create.c:312
  #14 0x00007f7343cb730d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) p m_status
  $25 = Diagnostics_area::DA_ERROR
(gdb) up
  #5  0x0000000000aa1ab6 in my_ok (thd=0x2d98f30, affected_rows=1, id=0, message=0x7f7345d70f20 "Rows matched: 1  Changed: 1  Warnings: 1") at /home/psergey/dev-git/mysql-5.6-rocksdb-issue108/sql/sql_class.h:4528
(gdb) p thd->query_string
  $28 = {string = {str = 0x7f7324006fb0 "UPDATE `table1_key_pk_parts_2_int_autoinc` SET `col_set_latin1_not_null_key` = 7 WHERE `col_int_key` < 9 LIMIT 6", length = 112}, cs = 0x1dc5c20 <my_charset_latin1>}
(gdb) 

@mariadb-DanielLee
Copy link
Author

commit f03213b
Author: Yoshinori Matsunobu yoshinori@fb.com
Date: Fri Dec 4 13:42:46 2015 -0800

I made a release build using the above source. I ran the following test 5 times for a total of 500 executions. All tests passed.

In a shell script, repeat this command 100 times.
perl gentest.pl --dsn=dbi:mysql:host=localhost:port=3306:user=root:database=test:mysql_socket=/tmp/mysql.sock --gendata=conf/examples/example.zz --grammar=conf/examples/example.yy --threads=10 --queries=1000

NOTE: I used 1000 queries instead of 10000 in the original bug description.

For the save test, when I increase the threads parameter value to 20 or 50, test failed somewhere within the 100 test executions.

Here is the back trace of the core dump file.

myrocks@rocksdb:/tmp$ gdb /home/myrocks/builds/mytest/mysql-5.6/sql/mysqld core
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/myrocks/builds/mytest/mysql-5.6/sql/mysqld...done.
[New LWP 46461]
[New LWP 38939]
[New LWP 38935]
[New LWP 38941]
[New LWP 38940]
[New LWP 38942]
[New LWP 38980]
[New LWP 46451]
[New LWP 38982]
[New LWP 46161]
[New LWP 46457]
[New LWP 46459]
[New LWP 46384]
[New LWP 46411]
[New LWP 46453]
[New LWP 46413]
[New LWP 45561]
[New LWP 46116]
[New LWP 46381]
[New LWP 46337]
[New LWP 46341]
[New LWP 46463]
[New LWP 46465]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./mysqld --defaults-file=/home/myrocks/builds/mytest/mytest.cnf --rocksdb_stric'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 key_unpack (to=to@entry=0x7f11a1c29860, table=table@entry=0x7f114c023490, key=key@entry=0x7f115b028bf8)
at /home/myrocks/builds/mytest/mysql-5.6/sql/key.cc:443
443 KEY_PART_INFO *key_part_end= key->key_part + key->user_defined_key_parts;
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in
from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
(gdb) bt
#0 key_unpack (to=to@entry=0x7f11a1c29860, table=table@entry=0x7f114c023490, key=key@entry=0x7f115b028bf8)
at /home/myrocks/builds/mytest/mysql-5.6/sql/key.cc:443
#1 0x000000000066d52f in print_keydup_error (table=table@entry=0x7f114c023490, key=key@entry=0x7f115b028bf8,
msg=0x237e72a "Duplicate entry '%-.64s' for key '%-.192s'", errflag=errflag@entry=0) at /home/myrocks/builds/mytest/mysql-5.6/sql/handler.cc:3738
#2 0x000000000066dcf9 in print_keydup_error (errflag=0, key=0x7f115b028bf8, table=0x7f114c023490) at /home/myrocks/builds/mytest/mysql-5.6/sql/handler.cc:3759
#3 handler::print_error (this=0x7f114c025330, error=, errflag=0) at /home/myrocks/builds/mytest/mysql-5.6/sql/handler.cc:3809
#4 0x0000000000de4e5d in ha_partition::print_error (this=0x7f114c024d40, error=121, errflag=0) at /home/myrocks/builds/mytest/mysql-5.6/sql/ha_partition.cc:8103
#5 0x00000000007a9bc2 in write_record (thd=thd@entry=0x24b41b0, table=table@entry=0x7f114c023490, info=info@entry=0x7f11a1c2c120,
update=update@entry=0x7f11a1c2c1a0) at /home/myrocks/builds/mytest/mysql-5.6/sql/sql_insert.cc:1908
#6 0x00000000007ae608 in mysql_insert (thd=thd@entry=0x24b41b0, table_list=0x7f1144006b08, fields=..., values_list=..., update_fields=..., update_values=...,
duplic=DUP_ERROR, ignore=false) at /home/myrocks/builds/mytest/mysql-5.6/sql/sql_insert.cc:1030
#7 0x00000000007c709b in mysql_execute_command (thd=thd@entry=0x24b41b0, statement_start_time=statement_start_time@entry=0x7f11a1c2d7b0,
post_parse=post_parse@entry=0x7f11a1c2d930) at /home/myrocks/builds/mytest/mysql-5.6/sql/sql_parse.cc:4064
#8 0x00000000007ca4c7 in mysql_parse (thd=thd@entry=0x24b41b0, rawbuf=, length=, parser_state=parser_state@entry=0x7f11a1c2e0b0,
last_timer=last_timer@entry=0x7f11a1c2d930, async_commit=async_commit@entry=0x7f11a1c2d920 "") at /home/myrocks/builds/mytest/mysql-5.6/sql/sql_parse.cc:7233
#9 0x00000000007cbd12 in dispatch_command (command=COM_QUERY, thd=0x24b41b0, packet=, packet_length=)
at /home/myrocks/builds/mytest/mysql-5.6/sql/sql_parse.cc:1595
#10 0x00000000007cd80e in do_command (thd=) at /home/myrocks/builds/mytest/mysql-5.6/sql/sql_parse.cc:1071
#11 0x00000000007935b5 in do_handle_one_connection (thd_arg=) at /home/myrocks/builds/mytest/mysql-5.6/sql/sql_connect.cc:1071
#12 0x0000000000793679 in handle_one_connection (arg=) at /home/myrocks/builds/mytest/mysql-5.6/sql/sql_connect.cc:929
#13 0x00007f11a9f32182 in start_thread (arg=0x7f11a1c2f700) at pthread_create.c:312
#14 0x00007f11a943f47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb)

@hermanlee
Copy link
Contributor

This latest stack trace looks to be a different issue. The insert is failing because of an existing key, but unpacking the key triggers a segfault (possibly because the data is corrupted?). Is there a way for us to get access to these cores/source/build for debugging?

@hermanlee
Copy link
Contributor

I took a look at the core file. It looks like we might not be setting errkey properly when this duplicate key error occurs for the partitioned table.

(gdb) f 2
#2 0x000000000066dcf9 in print_keydup_error (errflag=0, key=0x7f115b028bf8, table=0x7f114c023490) at /home/myrocks/builds/mytest/mysql-5.6/sql/handler.cc:3759
3759 print_keydup_error(table, key, ER(ER_DUP_ENTRY_WITH_KEY_NAME), errflag);
(gdb) p key
$2 = (KEY *) 0x7f115b028bf8
(gdb) p table->key_info
$3 = (KEY *) 0x7f114c027f50
(gdb) p $2 - $3
$4 = 2097179
(gdb) p table->file->errkey
$5 = 2097179

@yoshinorim
Copy link
Contributor

When I ran master/slave mismatch test (#107), MyRocks slave crashed because of the wrong errkey. This matches Herman's last issue.

(gdb) bt
#0  0x00007f837938a631 in __pthread_kill (threadid=<optimized out>, signo=11) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000000723883 in handle_fatal_signal(int) (sig=11) at /home/yoshinori/local/mysql/5.6/sql/signal_handler.cc:239
#2  0x00007f837938d550 in <signal handler called> () at /usr/local/fbcode/gcc-4.8.1-glibc-2.17/lib/libpthread.so.0
#3  0x000000000070d5da in key_unpack(String*, TABLE*, st_key*) (to=to@entry=0x7f836e756840, table=0x7f837088ee00, key=key@entry=0x7f9c771bf250) at /home/yoshinori/local/mysql/5.6/sql/key.cc:443
#4  0x0000000000658152 in print_keydup_error(TABLE*, st_key*, char const*, int) (table=<optimized out>, key=0x7f9c771bf250, msg=0x7f837677b33a "Duplicate entry '%-.64s' for key '%-.192s'", errflag=errflag@entry=0) at /home/yoshinori/local/mysql/5.6/sql/handler.cc:3738
#5  0x00000000006582f2 in print_keydup_error(TABLE*, st_key*, int) (table=<optimized out>, key=<optimized out>, errflag=errflag@entry=0) at /home/yoshinori/local/mysql/5.6/sql/handler.cc:3759
#6  0x0000000000658ccc in handler::print_error(int, int) (this=0x7f83708af410, error=121, errflag=0) at /home/yoshinori/local/mysql/5.6/sql/handler.cc:3809
#7  0x0000000000e2146d in ha_partition::print_error(int, int) (this=0x7f83708cd810, error=121, errflag=0) at /home/yoshinori/local/mysql/5.6/sql/ha_partition.cc:8103
#8  0x00000000008095a6 in mysql_update(THD*, TABLE_LIST*, List<Item>&, List<Item>&, Item*, unsigned int, st_order*, unsigned long long, enum_duplicates, bool, unsigned long long*, unsigned long long*) (thd=thd@entry=0x7f8372829640, table_list=<optimized out>, fields=..., values=..., conds=0x7f836d8314b8, order_num=<optimized out>, order=<optimized out>, limit=4, handle_duplicates=DUP_ERROR, ignore=false, found_return=found_return@entry=0x7f836e7594e0, updated_return=updated_return@entry=0x7f836e7595c0) at /home/yoshinori/local/mysql/5.6/sql/sql_update.cc:832
#9  0x00000000007a076a in mysql_execute_command(THD*, unsigned long long*, unsigned long long*) (thd=thd@entry=0x7f8372829640, statement_start_time=statement_start_time@entry=0x7f836e75a740, post_parse=post_parse@entry=0x7f836e75a8d0) at /home/yoshinori/local/mysql/5.6/sql/sql_parse.cc:3923
#10 0x00000000007a42e7 in mysql_parse(THD*, char*, unsigned int, Parser_state*, unsigned long long*, char*) (thd=thd@entry=0x7f8372829640, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f836e75b050, last_timer=last_timer@entry=0x7f836e75a8d0, async_commit=async_commit@entry=0x7f836e75a8c0 "") at /home/yoshinori/local/mysql/5.6/sql/sql_parse.cc:7233
#11 0x00000000007a5adb in dispatch_command(enum_server_command, THD*, char*, unsigned int) (command=COM_QUERY, thd=0x7f8372829640, packet=<optimized out>, packet_length=<optimized out>) at /home/yoshinori/local/mysql/5.6/sql/sql_parse.cc:1595

(gdb) frame 3
#3  key_unpack (to=to@entry=0x7f836e756840, table=0x7f837088ee00, key=key@entry=0x7f9c771bf250) at /home/yoshinori/local/mysql/5.6/sql/key.cc:443
443       KEY_PART_INFO *key_part_end= key->key_part + key->user_defined_key_parts;
(gdb) p key->key_part
Cannot access memory at address 0x7f9c771bf288
(gdb) p key->user_defined_key_parts
Cannot access memory at address 0x7f9c771bf268
(gdb) p key
$1 = (KEY *) 0x7f9c771bf250
(gdb) p *key
Cannot access memory at address 0x7f9c771bf250

(gdb) p &table->key_info[0]
$39 = (KEY *) 0x7f8370857010
(gdb) p &table->key_info[1]
$40 = (KEY *) 0x7f8370857088
(gdb) p &table->key_info[2]
$41 = (KEY *) 0x7f8370857100
(gdb) p &table->key_info[3]
$42 = (KEY *) 0x7f8370857178
(gdb) p &table->key_info[4]
$43 = (KEY *) 0x7f83708571f0

(gdb) p error
$45 = 121
(gdb) p table
$46 = (TABLE *) 0x7f837088ee00

uint handler::get_dup_key(int error)
(gdb) p table->file->errkey
$47 = 895705912

@hermanlee
Copy link
Contributor

The bug is not setting the errkey in the update path. errkey is set when info is called, but the error is printed out before info is called. It should be easy to fix by setting errkey and dupp_errkey when the problem occurs. dupp_errkey is still needed for info to be more precise about which index caused the duplicate key error. I'll post a fix shortly.

@spetrunia
Copy link
Contributor

(I believe, the assert failure that I am seeing is not related to the errkey problem)

Added code to save the stack trace when Diagnostics' area m_status changes to DA_ERROR.

Then, repeated the assert failure, it occurred here:

(gdb) wher 10
  #0  0x00007f6cc7dfdf79 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
  #1  0x00007f6cc7e01388 in __GI_abort () at abort.c:89
  #2  0x00007f6cc7df6e36 in __assert_fail_base (fmt=0x7f6cc7f48718 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x154cf26 "! is_set()", file=file@entry=0x154cd38 "/home/psergey/dev-git/mysql-5.6-rocksdb-issue105/sql/sql_error.cc", line=line@entry=434, function=function@entry=0x154d3a0 <_ZZN16Diagnostics_area13set_ok_statusEyyPKcE19__PRETTY_FUNCTION__> "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:92
  #3  0x00007f6cc7df6ee2 in __GI___assert_fail (assertion=0x154cf26 "! is_set()", file=0x154cd38 "/home/psergey/dev-git/mysql-5.6-rocksdb-issue105/sql/sql_error.cc", line=434, function=0x154d3a0 <_ZZN16Diagnostics_area13set_ok_statusEyyPKcE19__PRETTY_FUNCTION__> "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:101
  #4  0x0000000000ae6244 in Diagnostics_area::set_ok_status (this=0x35ec478, affected_rows=0, last_insert_id=0, message=0x7f6cca01df20 "Rows matched: 0  Changed: 0  Warnings: 1") at /home/psergey/dev-git/mysql-5.6-rocksdb-issue105/sql/sql_error.cc:434
  #5  0x0000000000aa1a06 in my_ok (thd=0x35e7ec0, affected_rows=0, id=0, message=0x7f6cca01df20 "Rows matched: 0  Changed: 0  Warnings: 1") at /home/psergey/dev-git/mysql-5.6-rocksdb-issue105/sql/sql_class.h:4533
  #6  0x0000000000bb3b4e in mysql_update (thd=0x35e7ec0, table_list=0x7f6cb0000c68, fields=..., values=..., conds=0x7f6cb00016e8, order_num=0, order=0x0, limit=2, handle_duplicates=DUP_ERROR, ignore=false, found_return=0x7f6cca01e3a0, updated_return=0x7f6cca01e480) at /home/psergey/dev-git/mysql-5.6-rocksdb-issue105/sql/sql_update.cc:1043

and the record shows it happened here:

sql/sql_error.cc:553
sql/sql_class.cc:1355
sql/mysqld.cc:3926
mysys/my_error.c:186  
storage/rocksdb/ha_rocksdb.cc:5506 (discriminator 1)  
storage/rocksdb/ha_rocksdb.cc:4374 (discriminator 1)  return_status_error
storage/rocksdb/ha_rocksdb.cc:3553  ha_rocksdb::get_row_by_rowid
storage/rocksdb/ha_rocksdb.cc:4446  ha_rocksdb::index_next_with_direction
storage/rocksdb/ha_rocksdb.cc:4528 ha_rocksdb::index_first_intern
storage/rocksdb/ha_rocksdb.cc:4458 (discriminator 3) ha_rocksdb::index_first
sql/handler.cc:3077  handler::ha_index_first
storage/rocksdb/ha_rocksdb.cc:3589  ha_rocksdb::read_range_first
sql/handler.cc:6113 (discriminator 6) handler::multi_range_read_next
sql/opt_range.cc:10646 
sql/records.cc:367 (discriminator 1)
sql/sql_update.cc:763 (discriminator 1) 
  mysql_update, " while (!(error=info.read_record(&info)) && !thd->killed)" line
sql/sql_parse.cc:3925

@spetrunia
Copy link
Contributor

A deterministic testcase for the assert:

--source include/have_rocksdb.inc

connect (con2,localhost,root,,);
connection default;

create table t1 (
  pk int not null primary key, 
  col1 int not null, 
  col2 int not null, 
  key(col1)
) engine=rocksdb;

create table ten(a int primary key);
insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);

create table one_k(a int primary key);
insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C;

insert into t1 select a,a,a from one_k;

--echo # Start the transaction, get the snapshot
begin;
select * from t1 where col1<10;

--echo # Connect with another connection and force memtable flush
connection con2;

begin;
insert into t1 values (1001,1001,1001);
commit;
set global rocksdb_force_flush_memtable_now=1;

connection default;

update t1 set col2=col2+1 where col1 < 10 limit 2;

disconnect con2;
drop table t1, ten, one_k;

@spetrunia
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants