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

Reduce usage of LOCK_open: TABLE_SHARE::tdc.used_tables

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.7
    • None
    • None

    Description

      tc_acquire_table and tc_release_table are critical sections of table cache. Among other things, they update TABLE_SHARE::tdc.used_tables:
      tc_acquire_table - push new TABLE object to used_tables
      tc_release_table - remove TABLE object from used_tables

      used_tables list is not really necessary for table cache to operate properly. We can change it with all_tables list instead. tc_acquire_table and tc_release_table wont need to access all_tables list at all.

      The cost is as following:

      • 2 additional pointers per TABLE object
      • SHOW OPEN TABLES will have to iterate all_tables and skip objects with in_use == 0
      • same for TABLE_SHARE::visit_subgraph()
      • same for kill_delayed_threads_for_table()

      A patch for this task has been tested (read-only single table OLTP, 4 CPU linux server) and shown ~30% lower LOCK_open wait time and ~20% higher tps.

      Attachments

        Issue Links

          Activity

            svoj Sergey Vojtovich created issue -
            svoj Sergey Vojtovich made changes -
            Field Original Value New Value
            svoj Sergey Vojtovich made changes -
            Description tc_acquire_table and tc_release_table are critical sections of table cache. Among other things, they update TABLE_SHARE::tdc.used_tables:
            tc_acquire_table - push new TABLE object to used_tables
            tc_release_table - remove TABLE object from used_tables

            used_tables list is not really necessary for table cache to operate properly. We can change it with all_tables list instead. tc_acquire_table and tc_release_table wont need to access all_tables list at all.

            The cost is as following:
            - 2 additional pointers per TABLE object
            - SHOW OPEN TABLES will have to iterate all_tables and skip objects with in_use == 0
            - same for TABLE_SHARE::visit_subgraph

            A patch for this task has been tested (read-only single table OLTP, 4 CPU linux server) and shown ~30% lower LOCK_open wait time and ~20% higher tps.
            tc_acquire_table and tc_release_table are critical sections of table cache. Among other things, they update TABLE_SHARE::tdc.used_tables:
            tc_acquire_table - push new TABLE object to used_tables
            tc_release_table - remove TABLE object from used_tables

            used_tables list is not really necessary for table cache to operate properly. We can change it with all_tables list instead. tc_acquire_table and tc_release_table wont need to access all_tables list at all.

            The cost is as following:
            - 2 additional pointers per TABLE object
            - SHOW OPEN TABLES will have to iterate all_tables and skip objects with in_use == 0
            - same for TABLE_SHARE::visit_subgraph()
            - same for kill_delayed_threads_for_table()

            A patch for this task has been tested (read-only single table OLTP, 4 CPU linux server) and shown ~30% lower LOCK_open wait time and ~20% higher tps.
            svoj Sergey Vojtovich made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            svoj Sergey Vojtovich made changes -
            Attachment mdev4956.patch [ 23301 ]
            svoj Sergey Vojtovich made changes -
            Assignee Sergey Vojtovich [ svoj ] Sergei Golubchik [ serg ]

            Sergei, please review attached patch. Committed patch didn't reach mailing list for some reason.

            svoj Sergey Vojtovich added a comment - Sergei, please review attached patch. Committed patch didn't reach mailing list for some reason.
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Sergey Vojtovich [ svoj ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.0.6 [ 13202 ]
            Fix Version/s 10.0.5 [ 13201 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.0.7 [ 14100 ]
            Fix Version/s 10.0.6 [ 13202 ]
            svoj Sergey Vojtovich made changes -
            svoj Sergey Vojtovich made changes -
            svoj Sergey Vojtovich made changes -
            Assignee Sergey Vojtovich [ svoj ] Sergei Golubchik [ serg ]

            Sergei, please review updated patch:
            Date: Tue, 10 Dec 2013 15:00:43 +0000 (UTC)
            From: Sergey Vojtovich <svoj@mariadb.org>
            To: commits@mariadb.org
            Subject: [Commits] Rev 3914: MDEV-4956 - Reduce usage of LOCK_open: TABLE_SHARE::tdc.used_tables in lp:maria/10.0

            svoj Sergey Vojtovich added a comment - Sergei, please review updated patch: Date: Tue, 10 Dec 2013 15:00:43 +0000 (UTC) From: Sergey Vojtovich <svoj@mariadb.org> To: commits@mariadb.org Subject: [Commits] Rev 3914: MDEV-4956 - Reduce usage of LOCK_open: TABLE_SHARE::tdc.used_tables in lp:maria/10.0
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]

            Pushed to 10.0.7, revision-id: svoj@mariadb.org-20131210150036-imkvngj5125mukqu

            svoj Sergey Vojtovich added a comment - Pushed to 10.0.7, revision-id: svoj@mariadb.org-20131210150036-imkvngj5125mukqu
            svoj Sergey Vojtovich made changes -
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            svoj Sergey Vojtovich made changes -
            svoj Sergey Vojtovich made changes -
            svoj Sergey Vojtovich made changes -
            svoj Sergey Vojtovich made changes -
            svoj Sergey Vojtovich made changes -
            serg Sergei Golubchik made changes -
            Workflow defaullt [ 28709 ] MariaDB v2 [ 43829 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Workflow MariaDB v2 [ 43829 ] MariaDB v3 [ 63029 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 63029 ] MariaDB v4 [ 132184 ]

            People

              serg Sergei Golubchik
              svoj Sergey Vojtovich
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.