Error page NNN is of wrong type (expected 7, found N) [CORE2684] #3087
Submitted by: @hvlad
BTR\garbage_collect() fetched parent, left, gc and right pages to do its job.
Parent page number is passed into garbage_collect() as parameter and this page is fetched as pag_undefined with verification after the fetch that it is still belongs to the index.
Left page number was stored in variable while gc_page was locked. When left page is fetched it is assumed that its is still index page but this is wrong assumption.
Solution is to fetch left page the same way as parent page - as pag_undefined with verification it is still belongs to the index.
gc_page and right pages fetched as pag_index pages and it is safe as page numbers got from the currently locked left and gc_page accordingly.
The text was updated successfully, but these errors were encountered: