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

TokuDB: multiple locks and unlock of not locked TOKUDB_SHARE::num_DBs_lock

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.37
    • 5.5.38
    • None

    Description

      Found while analyzing test failures for MDEV-5089.

      To reproduce these problems compile MariaDB as described in MDEV-5089 with -DUSE_MUTEX_INSTEAD_OF_RW_LOCKS. Run tokudb and tokudb_bugs test suites.

      First, there are attempts to lock read-locked num_DBs_lock. It is locked in ha_tokudb::start_bulk_insert() and then in ha_tokudb::update_row() or ha_tokudb::acquire_table_lock(). It may be not a problem, but as this situation is handled in ha_tokudb::write_row() it should be checked at least.

      Second, ha_tokudb::write_row() unlocks not locked num_DBs_lock (in case of error in the very beginning of the function). This should be a problem according to the pthread_rwlock_unlock manual: results are undefined if the read-write lock rwlock is not held by the calling thread.

      A rough patching solving the above issues attached.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              svoj Sergey Vojtovich
              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.