Comment 4 for bug 1189430

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote : Re: Crash during sysbench

I have been able to crash it under gdb. Attached bt and 'thread
apply all bt full' (latter is really comprehensive) outputs. It also has the log.

However, after analysis and from crash, it looks like:

#2 0x00000000008772d2 in row_sel_store_mysql_rec (
     mysql_rec=mysql_rec@entry=0x7fff8800ff10 "\377\344:", prebuilt=prebuilt@entry=0x7fff880107d8,
     rec=rec@entry=0x7fffd42fa6af "", rec_clust=rec_clust@entry=0, offsets=0x7fffac0efdb0)
     at /media/Tintin/Work/code/percona-xtradb-cluster/release-5.5.31/Percona-Server/storage/innobase/row/row0sel.c:2724
 #3 0x000000000087c565 in row_search_for_mysql (buf=0x7fff8800ff10 "\377\344:", mode=2,
     prebuilt=0x7fff880107d8, match_mode=1, direction=0)

rec is empty in #2.

a)row_sel_try_search_shortcut_for_mysql called by row_search_for_mysql does a:

 if (rec_get_deleted_flag(rec, dict_table_is_comp(index->table))) {

  return(SEL_EXHAUSTED);
 }

b) row_search_for_mysql also checks: ut_ad(!rec_get_deleted_flag(rec, comp));

   switch (row_sel_try_search_shortcut_for_mysql(
     &rec, prebuilt, &offsets, &heap,
     &mtr)) {
   case SEL_FOUND:
#ifdef UNIV_SEARCH_DEBUG
    ut_a(0 == cmp_dtuple_rec(search_tuple,
        rec, offsets));
#endif
    /* At this point, rec is protected by
    a page latch that was acquired by
    row_sel_try_search_shortcut_for_mysql().
    The latch will not be released until
    mtr_commit(&mtr). */
    ut_ad(!rec_get_deleted_flag(rec, comp));

    if (!row_sel_store_mysql_rec(buf, prebuilt,
            rec, FALSE,
            offsets)) {

c) Finally row_sel_store_mysql_rec also checks ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets))):

 ut_ad(prebuilt->mysql_template);
 ut_ad(prebuilt->default_rec);
 ut_ad(rec_offs_validate(rec, NULL, offsets));
 ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));

=============================================================================
Interesting pat is that: ut_ad(!rec_get_deleted_flag(rec, comp));
in b is not triggered rather c after that is triggered.

Also, note that this is not that hard to trigger but required
sometime to be triggered. (30-40 min of sysbench)