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

ibuf_bitmap_mutex is an unnecessary contention point

    XMLWordPrintable

Details

    Description

      The only purpose of ibuf_bitmap_mutex is to prevent a deadlock between two concurrent invocations of ibuf_update_free_bits_for_two_pages_low(a,b,mtr1) and ibuf_update_free_bits_for_two_pages_low(b,a,mtr2). The mutex is unnecessarily serializing the execution of the function. To avoid deadlocks, the following should suffice:

        /* Avoid a deadlock by acquiring multiple bitmap page latches in
        a consistent order (smaller page identifier first). */
        if (block1->page.id() > block2->page.id())
          std::swap(block1, block2);
       
        ibuf_set_free_bits_low(block1, ibuf_index_page_calc_free(block1), mtr);
        ibuf_set_free_bits_low(block2, ibuf_index_page_calc_free(block2), mtr);
      

      Attachments

        Activity

          People

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