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

Cleanup MDL_request boilerplate

    XMLWordPrintable

Details

    Description

      Currently typical MDL lock acquisition is as follows:

      MDL_request mdl_request;
      MDL_REQUEST_INIT(&mdl_request, namespace, db, object, lock_type, duration);
      if (mdl_context.acquire_lock(&mdl_request, lock_wait_timeout))
        /* error handling */;
      ticket= mdl_request.ticket;
      

      This should be replaced with:

      if (!(ticket= mdl_context.ACQUIRE_LOCK(namespace, db, object, lock_type, lock_wait_timeout)))
        /* error handling */;
      

      This will significantly lower MDL_request exposure and should reduce likelihood of bugs like MDEV-39241. This is a step towards making MDL_request a private class of MDL, such that issues like MDEV-39184 will not pop up again.

      Attachments

        Issue Links

          Activity

            People

              svoj Sergey Vojtovich
              svoj Sergey Vojtovich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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