Skip to content

Commit

Permalink
MDEV-31362 recv_sys_t::apply(bool): Assertion `!last_batch || recover…
Browse files Browse the repository at this point in the history
…ed_lsn == scanned_lsn' failed

recv_sys_t::apply(): Remove a bogus debug assertion that had been
added in commit f2c17cc (MDEV-29911).

It is perfectly normal that when the server was killed in the middle of
writing multiple redo log blocks, the recovery would end such that
recv_sys.scanned_lsn will point to the end of the last complete 512-byte
log block, but recv_sys.recovered_lsn will be less than that.

Also, correct the function comment of recv_sys_t::parse().
  • Loading branch information
dr-m committed May 30, 2023
1 parent ea66df2 commit a6c0a27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion storage/innobase/include/log0recv.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ struct recv_sys_t
bool add(map::iterator it, lsn_t start_lsn, lsn_t lsn,
const byte *l, size_t len);

/** Parse and register one mini-transaction in log_t::FORMAT_10_5.
/** Parse and register mini-transactions in log_t::FORMAT_10_5.
@param checkpoint_lsn the log sequence number of the latest checkpoint
@param store whether to store the records
@param apply whether to apply file-level log records
Expand Down
5 changes: 2 additions & 3 deletions storage/innobase/log/log0recv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2396,15 +2396,15 @@ void recv_sys_t::rewind(const byte *end, const byte *begin) noexcept
pages_it= pages.end();
}

/** Parse and register one mini-transaction in log_t::FORMAT_10_5.
/** Parse and register mini-transactions in log_t::FORMAT_10_5.
@param checkpoint_lsn the log sequence number of the latest checkpoint
@param store whether to store the records
@param apply whether to apply file-level log records
@return whether FILE_CHECKPOINT record was seen the first time,
or corruption was noticed */
bool recv_sys_t::parse(lsn_t checkpoint_lsn, store_t *store, bool apply)
{
restart:
restart:
mysql_mutex_assert_owner(&log_sys.mutex);
mysql_mutex_assert_owner(&mutex);
ut_ad(parse_start_lsn);
Expand Down Expand Up @@ -3626,7 +3626,6 @@ void recv_sys_t::apply(bool last_batch)
recv_no_ibuf_operations = !last_batch ||
srv_operation == SRV_OPERATION_RESTORE ||
srv_operation == SRV_OPERATION_RESTORE_EXPORT;
ut_ad(!last_batch || recovered_lsn == scanned_lsn);
progress_time= time(nullptr);
report_progress();

Expand Down

0 comments on commit a6c0a27

Please sign in to comment.