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

sux_lock::s_lock(): Assertion !have_s() failed on startup

    XMLWordPrintable

Details

    Description

      In MDEV-25743, the function dict_check_sys_tables() was simplified in such a way that the mini-transaction will not be committed and restarted during the loop. But, we failed to adjust the call that would advance the cursor position:

      diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
      index ac81de9a25c..db11f4ff003 100644
      --- a/storage/innobase/dict/dict0load.cc
      +++ b/storage/innobase/dict/dict0load.cc
      @@ -834,7 +834,7 @@ static ulint dict_check_sys_tables()
       
       	for (const rec_t *rec = dict_startscan_system(&pcur, &mtr,
       						      dict_sys.sys_tables);
      -	     rec; rec = dict_getnext_system(&pcur, &mtr)) {
      +	     rec; rec = dict_getnext_system_low(&pcur, &mtr)) {
       		ulint		len;
       		table_id_t	table_id;
       		ulint		space_id;
      

      It is unclear to me why this would not cause failures much more often. The incorrect call would attempt to restore the persistent cursor position while we are already holding a latch on the page. Recursive S-latches are not supported and could lead to a hang. A hang should however not be possible, because the purge of history is not yet running at this point of time, and no other thread should be acquiring conflicting latches on the page.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              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.