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

Redundant FILE_CHECKPOINT writes

    XMLWordPrintable

Details

    Description

      Related to MDEV-38289 and a failure of an end_lsn assertion failure that is being added in MDEV-37949 I found out that the check at the start of log_checkpoint_low() is not preventing redundant writes of FILE_CHECKPOINT records. What I am observing is a stream of identical FILE_CHECKPOINT records pointing to the same checkpoint LSN. These durable writes (including fsync(2) or fdatasync(2) or equivalent) should cost some performance.

      I was able to reproduce the problem on 10.11 with the following patch, placing the data directory outside /dev/shm:

      diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
      index 189a506c3a3..e4edb020a9c 100644
      --- a/storage/innobase/buf/buf0buf.cc
      +++ b/storage/innobase/buf/buf0buf.cc
      @@ -587,6 +587,7 @@ static bool buf_page_check_lsn(bool check_lsn, const byte *read_buf) noexcept
                         " is in the future! Current system log sequence number "
                         LSN_PF ".",
                         space_id, page_no, page_lsn, current_lsn);
      +  ut_a(((current_lsn - 0x3032) & 15) || current_lsn == 0x3032 || current_lsn == 0x3042);
       
         if (srv_force_recovery)
           return false;
      diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
      index 43682200710..7bb1d5d0bdc 100644
      --- a/storage/innobase/buf/buf0flu.cc
      +++ b/storage/innobase/buf/buf0flu.cc
      @@ -2013,6 +2013,9 @@ static bool log_checkpoint_low(lsn_t oldest_lsn, lsn_t end_lsn) noexcept
           return true;
         }
       
      +  //ut_a(oldest_lsn != 0x3032);
      +  ut_a(((oldest_lsn - 0x3032) & 15) || oldest_lsn <= 12354);
      +
         ut_ad(!recv_no_log_write);
         ut_ad(oldest_lsn > log_sys.last_checkpoint_lsn);
         /* Repeat the FILE_MODIFY records after the checkpoint, in case some
      

      while mysql-test/mtr --rr=-h --parallel=auto innodb.log_corruption_recovery{,,,,,}{,,}; do :; done
      

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              marko Marko Mäkelä
              Marko Mäkelä Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.