MDEV-17289 Multi-pass recovery fails to apply some redo log records

This is a regression caused by
commit 73af8af0
(MDEV-15325 Incomplete validation of missing tablespace during recovery).

If the recv_sys->addr_hash hash table ran out of memory, we would
have to do crash recovery in multiple passes. If some tablespaces were
missing, after the MDEV-15325 fix we would rescan the remaining redo log.
But, we could incorrectly reset the "rescan" flag. Because of this, we
would fail to apply some of the oldest redo log records to the data files.
(The recv_sys->addr_hash would only contain records from the latest
redo log scan batch.)

Fix:

After checking for missing tablespaces, reset the flag rescan=true,
so that all redo log records will be re-read and applied.
parent 753117fe
......@@ -3582,6 +3582,8 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
then there is a possiblity that hash table will not contain
all space ids redo logs. Rescan the remaining unstored
redo logs for the validation of missing tablespace. */
ut_ad(rescan || !missing_tablespace);
while (missing_tablespace) {
DBUG_PRINT("ib_log", ("Rescan of redo log to validate "
"the missing tablespace. Scan "
......@@ -3606,6 +3608,8 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
log_mutex_exit();
return err;
}
rescan = true;
}
if (srv_operation == SRV_OPERATION_NORMAL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment