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

log_t::persist(): Assertion is_opened() == archive failed

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      I encountered a debug assertion while working on MDEV-14992. The scenario involves crash recovery with innodb_log_file_mmap=ON and a startup with innodb_log_archive=OFF while a log file in the innodb_log_archive=ON format exists (ib_0000000000003000.log).

      The assertion would fail when crash recovery is writing back recovered data pages. It invokes log_file_up_to(), which in this case would be a no-op, because the log_sys.flushed_to_disk_lsn would have been recovered from the log. Yet, a debug assertion would fail because we are asserting right before checking that if a write is actually needed. The patch below fixes the issue:

      diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
      index 6364f9fc496..aad4f768f08 100644
      --- a/storage/innobase/log/log0log.cc
      +++ b/storage/innobase/log/log0log.cc
      @@ -1544,13 +1544,14 @@ void log_t::persist(lsn_t lsn) noexcept
         ut_ad(!write_lock.is_owner());
         ut_ad(!flush_lock.is_owner());
         ut_ad(latch_have_wr());
      -  ut_ad(is_opened() == archive);
       
         lsn_t old= flushed_to_disk_lsn.load(std::memory_order_relaxed);
       
         if (old > lsn)
           return;
       
      +  ut_ad(is_mmap_writeable());
      +  ut_ad(is_opened() == archive);
         const size_t start(calc_lsn_offset(old));
         const size_t end(calc_lsn_offset(lsn));
       
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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