Bug #40579 Maria: assertion in page cache in check_and_set_lsn()
Submitted: 7 Nov 2008 15:20 Modified: 10 Mar 2009 14:39
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Maria storage engine Severity:S3 (Non-critical)
Version:5.1-maria OS:Any
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[7 Nov 2008 15:20] Guilhem Bichot
Description:
Under concurrency we see an assertion failing on two machines (linux, solaris):
#8 0x0074315b in __assert_fail () from /lib/libc.so.6 #9 0x0857eb90 in check_and_set_lsn (pagecache=0x9151d20, lsn=4298174204,
    block=0xb22e18c0) at ma_pagecache.c:2703
#10 0x0857fb1b in pagecache_unlock_by_link (pagecache=0x9151d20,
    block=0xb22e18c0, lock=PAGECACHE_LOCK_READ_UNLOCK, pin=PAGECACHE_UNPIN, 
    first_REDO_LSN_for_page=4298174152, lsn=4298174204, was_changed=1 '\001', 
    any=0 '\0') at ma_pagecache.c:2978
#11 0x0859e3d2 in _ma_unpin_all_pages (info=0x9c4ff08, undo_lsn=4298174204)
    at ma_key_recover.c:70
#12 0x085b622d in write_block_record (info=0x9c4ff08, old_record=0x0,
    record=0x9b86d60 "d", row=0x9c4ff50, bitmap_blocks=0x9c4ff50, 
    head_block_is_read=1 '\001', row_pos=0xb1f4fd00, undo_lsn=1, 
    old_record_checksum=0) at ma_blockrec.c:3268
#13 0x085b66b6 in allocate_and_write_block_record (info=0x9c4ff08,
    record=0x9b86d60 "d", row=0x9c4ff50, undo_lsn=1) at ma_blockrec.c:3396
#14 0x085b688b in _ma_write_init_block_record (info=0x9c4ff08,
    record=0x9b86d60 "d") at ma_blockrec.c:3439
#15 0x085c5186 in maria_write (info=0x9c4ff08, record=0x9b86d60 "d")
    at ma_write.c:151
#16 0x0858982a in ha_maria::write_row (this=0x9b86c40, buf=0x9b86d60 "d")
    at ha_maria.cc:968
#17 0x0836d379 in handler::ha_write_row (this=0x9b86c40, buf=0x9b86d60 "d")
    at handler.cc:4470
#18 0x082e772e in write_record (thd=0x9b6b680, table=0x9b6af10, info=0x9c22244)
    at sql_insert.cc:1560
#19 0x082e7afb in select_insert::send_data (this=0x9c22220, values=@0x9b6caf4)
    at sql_insert.cc:3072
#20 0x082ba6dd in end_send (join=0x9c22298, join_tab=0xb13f1fc8,
    end_of_records=false) at sql_select.cc:12099
#21 0x082c0c09 in evaluate_join_record (join=0x9c22298, join_tab=0xb13f1e40,
    error=0) at sql_select.cc:11359
#22 0x082c0e1a in sub_select (join=0x9c22298, join_tab=0xb13f1e40,
    end_of_records=false) at sql_select.cc:11250
#23 0x082c8f83 in do_select (join=0x9c22298, fields=0x9b6caf4, table=0x0,
    procedure=0x0) at sql_select.cc:11000
#24 0x082e17c2 in JOIN::exec (this=0x9c22298) at sql_select.cc:2205 #25 0x082dc899 in mysql_select (thd=0x9b6b680, rref_pointer_array=0x9b6cb58,
    tables=0x9c22028, wild_num=1, fields=@0x9b6caf4, conds=0x0, og_num=0, 
    order=0x0, group=0x0, having=0x0, proc_param=0x0, 
    select_options=3489942016, result=0x9c22220, unit=0x9b6c7e8, 
    select_lex=0x9b6ca60) at sql_select.cc:2384
#26 0x082e1ad2 in handle_select (thd=0x9b6b680, lex=0x9b6c78c,
    result=0x9c22220, setup_tables_done_option=1073741824) at sql_select.cc:279
#27 0x0825c8ff in mysql_execute_command (thd=0x9b6b680) at sql_parse.cc:3094 #28 0x082628f3 in mysql_parse (thd=0x9b6b680,
    inBuf=0x9c21cd0 "INSERT INTO g SELECT * FROM c", length=29, 
    found_semicolon=0xb1f5126c) at sql_parse.cc:5745

How to repeat:
run the test:
# 12:38:18 # runall.pl \ 
# 12:38:18 # --basedir=/export/home/pb2/test/sb_1-119437-1226057893.94/mysql-5.1.30-maria-alpha-linux-i686-test \ 
# 12:38:18 # --vardir=/export/home/pb2/test/sb_1-119437-1226057893.94/mysql-5.1.30-maria-alpha-linux-i686-test/vardirs \ 
# 12:38:18 # --reporters=Deadlock,ErrorLog,Backtrace,Recovery,WinPackage \ 
# 12:38:18 # --mysqld=--loose-falcon-lock-wait-timeout=1 \ 
# 12:38:18 # --mysqld=--loose-falcon-debug-mask=2 \ 
# 12:38:18 # --mysqld=--log-output=none \ 
# 12:38:18 # --mysqld=--log=off \ 
# 12:38:18 # --mysqld=--skip-safemalloc \ 
# 12:38:18 # --duration=1200 \ 
# 12:38:18 # --engine=Maria \ 
# 12:38:18 # --grammar=conf/maria_bulk_insert.yy \ 
# 12:38:18 # --queries=100000