Description:
after 'clone instance...' success, recover the mysql instance using the clone data will cause crashes because it cannot apply redo on one page in file mysql.ibd.
How to repeat:
1. add receipt_currency.test in directory `mysql-test/suite/clone/t/`;
2. run `./mtr clone.monitor_progress clone.receipt_courrency clone.remote_compress clone.remote_ddl_alter_copy --record` with debug version.
From error log:
2024-06-06T07:07:29.612201Z 1 [Note] [MY-012533] [InnoDB] 60%
2024-06-06T07:07:29.672459Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: page0page.ic:533:page_offset(rec) <= page_header_get_field(page, PAGE_HEAP_TOP) thread 140266961839872
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
2024-06-06T07:07:29Z UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
BuildID[sha1]=94e2e89670d7fbd1f9f9ed9567fcddb329b4f729
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x100000
2024-06-06T07:07:29.673586Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: page0page.ic:533:page_offset(rec) <= page_header_get_field(page, PAGE_HEAP_TOP) thread 140266951350016
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
2024-06-06T07:07:29.675369Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: page0cur.cc:1330:rec_get_status(current_rec) <= REC_STATUS_INFIMUM thread 140266940860160
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
2024-06-06T07:07:29.678292Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: page0cur.cc:1323:current_rec != insert_rec thread 140266652563200
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
2024-06-06T07:07:29.682672Z 1 [Note] [MY-012533] [InnoDB] 70%
mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x59) [0x55d894a90d52]
mysqld(print_fatal_signal(int)+0x38e) [0x55d8934d2c43]
mysqld(my_server_abort()+0x78) [0x55d8934d2ef9]
mysqld(my_abort()+0x11) [0x55d894a86c33]
mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x1e7) [0x55d894f9891a]
mysqld(+0x531bbbb) [0x55d894ddabbb]
mysqld(+0x531b788) [0x55d894dda788]
mysqld(page_cur_delete_rec(page_cur_t*, dict_index_t const*, unsigned long const*, mtr_t*)+0x1ad) [0x55d894de29cd]
mysqld(page_cur_parse_delete_rec(unsigned char*, unsigned char*, buf_block_t*, dict_index_t*, mtr_t*)+0x233) [0x55d894de27e0]
mysqld(+0x52bdd61) [0x55d894d7cd61]
mysqld(recv_recover_page_func(bool, buf_block_t*)+0x8a7) [0x55d894d7e486]
mysqld(+0x5581f63) [0x55d895040f63]
mysqld(buf_page_io_complete(buf_page_t*, bool)+0x814) [0x55d8950536d9]
mysqld(fil_aio_wait(unsigned long)+0x23d) [0x55d8951eadbc]
Suggested fix:
if apply the diff:
```
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index cc510f3c461..f9ffd5abea2 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -1353,7 +1353,7 @@ bool buf_flush_page(buf_pool_t *buf_pool, buf_page_t *bpage,
lsn_t frame_lsn = mach_read_from_8(frame + FIL_PAGE_LSN);
arch_page_sys->track_page(bpage, buf_pool->track_page_lsn, frame_lsn,
- false);
+ true);
}
```
`./mtr clone.monitor_progress clone.receipt_courrency clone.remote_compress clone.remote_ddl_alter_copy --record` will be sucess.
the diff will make page-tracking system track the same pageID many times.