Unnecessary AHI removal in buf_LRU_mark_space_was_deleted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Low
|
Laurynas Biveinis | |
| 5.1 |
Fix Released
|
Low
|
Laurynas Biveinis | |
| 5.5 |
Fix Released
|
Low
|
Laurynas Biveinis |
Bug Description
Recently I am trying to understand the code path of "drop table".
buf_LRU_
chunk = buf_pool->chunks;
for (j = buf_pool->n_chunks; j--; chunk++) {
for (k = chunk->size; k--; block++) {
if (buf_block_
}
}
}
btr_search_
But before fil_delete_
I am not sure if the code quoted above is redundant.
Related branches
- Alexey Kopytov (community): Approve on 2012-11-23
-
Diff: 91 lines (+12/-27)1 file modifiedPercona-Server/storage/innodb_plugin/buf/buf0lru.c (+12/-27)
- Alexey Kopytov (community): Approve on 2012-11-23
-
Diff: 91 lines (+13/-27)1 file modifiedPercona-Server/storage/innobase/buf/buf0lru.c (+13/-27)
yinfeng (yinfeng-zwx) wrote : | #2 |
buf_LRU_
case BUF_REMOVE_
/* A DROP table case. AHI entries are already
list. Just evict pages from flush list without
break;
backtrace of the first call to free page hash index entries:
#0 btr_search_
at /u01/project/
#1 0x0000000000855c29 in fseg_free_extent (seg_inode=<value optimized out>, space=17296, zip_size=4096, page=576, mtr=0x7fe183a5ffd0)
at /u01/project/
#2 0x0000000000856a24 in fseg_free_step (header=<value optimized out>, mtr=0x7fe183a5ffd0)
at /u01/project/
#3 0x00000000007f7441 in btr_free_
at /u01/project/
#4 0x0000000000826e7e in dict_drop_
at /u01/project/
#5 0x00000000007be8fd in row_upd_clust_step (node=0x7fe1780
at /u01/project/
#6 0x00000000007bf2be in row_upd (thr=0x7fe17802
#7 row_upd_step (thr=0x7fe17802
#8 0x00000000008a4b08 in que_thr_step (thr=0x7fe17802
#9 que_run_threads_low (thr=0x7fe17802
#10 que_run_threads (thr=0x7fe17802
#11 0x00000000008a5206 in que_eval_sql (info=<value optimized out>, sql=<value optimized out>, reserve_
trx=
#12 0x00000000007ac98a in row_drop_
at /u01/project/
#13 0x00000000007974c0 in ha_innobase:
at /u01/project/
#14 0x0000000000699f0e in ha_delete_table (thd=0x14870730, table_type=<value optimized out>, path=0x7fe183a62500 "./sbtest/sbtest6",
db=
Alexey Kopytov (akopytov) wrote : | #3 |
Yes, the code dropping page hash indexes in buf_LRU_
It was introduced as a fix for https:/
summary: |
- some confusing code in buf_LRU_mark_space_was_deleted + Unnecessary AHI scan in buf_LRU_mark_space_was_deleted |
Is it really an AHI scan as the bug title says now? It is actually a buffer pool scan.
Hm, right, thanks.
summary: |
- Unnecessary AHI scan in buf_LRU_mark_space_was_deleted + Unnecessary AHI removal in buf_LRU_mark_space_was_deleted |
Shahriyar Rzayev (rzayev-sehriyar) wrote : | #6 |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/
@yinfeng,
I noticed that both the lazy / non-lazy implementations call btr_search_ drop_page_ hash_index
if (srv_lazy_ drop_table) { mark_space_ was_deleted( id); flush_or_ remove_ pages( ALL_NO_ WRITE FLUSH_NO_ WRITE);
buf_LRU_
} else {
buf_LRU_
id, evict_all
? BUF_REMOVE_
: BUF_REMOVE_
}
buf_LRU_ flush_or_ remove_ pages also calls it.
Regarding btr_search_ drop_page_ hash_when_ freed from fseg_free_extent I noticed that only dict_truncate_ index_tree makes call to it in row_truncate_ table_for_ mysql, though that is done after fil_discard_ tablespace
Can you tell us the call-path where you found duplicate calls to btr_search_ drop_page_ hash_when_ freed / btr_search_ drop_page_ hash_index (gdb bt with drop table should do)?