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

trx_lock_t::table_locks is not a subset of trx_lock_t::trx_locks

    XMLWordPrintable

Details

    Description

      Testing a fix of MDEV-15326 revealed that if the call to trx->lock.table_locks.clear(); is skipped at transaction commit when trx->lock.trx_locks is empty, occasionally a transaction would be left with nonempty trx->lock.table_locks list. This proves that the table_locks is not a subset of trx_locks, like it is expected to be.

      We will need a test case for this, so that the bug can be found and fixed. To repeat the assertion failures, revert the following part of the MDEV-15326 fix:

      diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
      index 1dcca7c1f72..b06e15d4f37 100644
      --- a/storage/innobase/trx/trx0trx.cc
      +++ b/storage/innobase/trx/trx0trx.cc
      @@ -561,8 +561,6 @@ inline void trx_t::release_locks()
       
         if (UT_LIST_GET_LEN(lock.trx_locks))
           lock_trx_release_locks(this);
      -  else
      -    lock.table_locks.clear(); /* Work around MDEV-20483 */
       }
       
       /********************************************************************//**
      

      This should lead to occasional assertion failures on trx->lock.table_locks.empty() on transaction commit.

      Attachments

        1. MDEV-20483-B.test
          0.9 kB
          Matthias Leich
        2. MDEV-20483-C.test
          1.0 kB
          Matthias Leich

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.