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

lock_release_try() / lock_release_on_prepare_try() may fail due to transients

    XMLWordPrintable

Details

    Description

      lock_release_try() and lock_release_on_prepare_try() are used as deadlock-risk-free attempts to avoid taking exclusive lock_sys.latch for the lock-release operation.

      The functions make use of the "try-acquire" mechanism to query for a specific latch/mutex status and not wait on the resource, in case it's not free.

      It may be that instead of failing on the first check, retries (with a small PAUSE in between) can be done, to make the mechanism more robust to transients.

      This worsen the latency in the worst case scenario, but hopefully improves the common case, reducing the escalations to write-latching lock_sys.latch.

      A buggish and to be fine-tuned implementation is provided in commit 51bbb90 (only the lock_release_try() bits were positively tested, no coverage for lock_release_on_prepare_try()).

      Attachments

        Issue Links

          Activity

            People

              alessandro.vetere Alessandro Vetere
              alessandro.vetere Alessandro Vetere
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 3d
                  3d
                  Remaining:
                  Remaining Estimate - 3d
                  3d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified

                  Git Integration

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