Skip to content

Commit 020025d

Browse files
Bin Subjornmu
authored andcommitted
Bug#26779650 - LONG SEMAPHORE WAIT CAUSED BY DROP TABLE
This is due to the for-loop in btr_drop_ahi_for_table() will skip pages of status BUF_IO_WRITE, and re-check it again later. But there are some other reasons the status can't be changed to BUF_IO_NONE quickly. Thus it continues to iterate over LRU list over and over. This may last for severl seconds or even minutes. Current fix is to relax the condition to drop AHI for pages of BUF_IO_WRITE too, and it will yield for a while after every iteration over all LRU lists. Reviewed-by: Jimmy Yang <[email protected]>
1 parent 53cf8e9 commit 020025d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

storage/innobase/btr/btr0sea.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,8 @@ btr_drop_ahi_for_table(dict_table_t* table)
14791479

14801480
if (buf_page_get_state(bpage)
14811481
!= BUF_BLOCK_FILE_PAGE
1482-
|| bpage->io_fix != BUF_IO_NONE
1482+
|| (bpage->io_fix != BUF_IO_NONE
1483+
&& bpage->io_fix != BUF_IO_WRITE)
14831484
|| bpage->buf_fix_count > 0) {
14841485
continue;
14851486
}
@@ -1507,6 +1508,8 @@ btr_drop_ahi_for_table(dict_table_t* table)
15071508
drop[i], page_size);
15081509
}
15091510
}
1511+
1512+
os_thread_yield();
15101513
}
15111514
}
15121515

@@ -1548,7 +1551,8 @@ btr_drop_ahi_for_index(dict_index_t* index)
15481551

15491552
if (buf_page_get_state(bpage)
15501553
!= BUF_BLOCK_FILE_PAGE
1551-
|| bpage->io_fix != BUF_IO_NONE
1554+
|| (bpage->io_fix != BUF_IO_NONE
1555+
&& bpage->io_fix != BUF_IO_WRITE)
15521556
|| bpage->buf_fix_count > 0) {
15531557
continue;
15541558
}
@@ -1574,6 +1578,8 @@ btr_drop_ahi_for_index(dict_index_t* index)
15741578
drop[i], page_size);
15751579
}
15761580
}
1581+
1582+
os_thread_yield();
15771583
}
15781584
}
15791585

0 commit comments

Comments
 (0)