Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-19739

Avoid unnecessary page reads on recovery with innodb_log_optimize_ddl=ON

    Details

      Description

      The MDEV-12699 fix is too conservative when it comes to the MLOG_INDEX_LOAD records, which are written on certain types of ALTER TABLE operations when innodb_log_optimize_ddl=ON (the default setting). The patch explains it:

      diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
      index dbce6f90fc2..c6bc91f8273 100644
      --- a/storage/innobase/log/log0recv.cc
      +++ b/storage/innobase/log/log0recv.cc
      @@ -2434,7 +2434,8 @@ void recv_apply_hashed_log_recs(bool last_batch)
       					goto skip;
       				}
       
      -				if (space->enable_lsn) {
      +				if (UT_LIST_GET_FIRST(recv_addr->rec_list)
      +				    ->start_lsn < space->enable_lsn) {
       do_read:
       					fil_space_release(space);
       					recv_addr->state = RECV_NOT_PROCESSED;
      

      There is no need to read pages that were (re)initialized after the latest MLOG_INDEX_LOAD record for the tablespace was written. This was noticed while testing MDEV-19738.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                marko Marko Mäkelä
                Reporter:
                marko Marko Mäkelä
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: