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

Remove trx_sys_t::rw_trx_ids and trx_sys_t::serialisation_list

Details

    Description

      Take snapshot of registered read-write transaction identifiers directly
      from rw_trx_hash. It immediately saves one trx_sys.mutex lock, reduces
      size of another critical section protected by this mutex, and makes
      further optimisations like removing trx_sys_t::serialisation_list
      possible.

      Downside of this approach is bigger overhead for view opening, because
      iterating LF_HASH is more expensive compared to taking snapshot of an
      array. However for low concurrency overhead difference is negligible,
      while for high concurrency mutex is much bigger evil.

      Currently we still take trx_sys.mutex to serialise ReadView creation.
      This is required to keep serialisation_list ordered by trx->no as well
      as not to let purge thread to create more recent snapshot while another
      thread gets suspended during creation of older snapshot. This will
      become completely mutex free along with serialisation_list removal.

      Compared to previous implementation removing element from rw_trx_hash
      and serialisation_list is not atomic. We disregard all possible bad
      consequences (if there're any) since it will be solved along with
      serialisation_list removal.

      serialisation_list was supposed to instantly give minimum registered
      transaction serialisation number. However maintaining and accessing
      this list requires global mutex protection.

      Since we already take MVCC snapshot by iterating trx_sys_t::rw_trx_hash,
      it is cheap to integrate minimum registered transaction lookup into this
      iteration.

      Attachments

        Issue Links

          Activity

            svoj Sergey Vojtovich created issue -
            svoj Sergey Vojtovich made changes -
            Field Original Value New Value
            Epic Link MDEV-14442 [ 64369 ]
            svoj Sergey Vojtovich made changes -
            Description Take snapshot of registered read-write transaction identifiers directly
            from rw_trx_hash. It immediately saves one trx_sys.mutex lock, reduces
            size of another critical section protected by this mutex, and makes
            further optimisations like removing trx_sys_t::serialisation_list
            possible.

            Downside of this approach is bigger overhead for view opening, because
            iterating LF_HASH is more expensive compared to taking snapshot of an
            array. However for low concurrency overhead difference is negligible,
            while for high concurrency mutex is much bigger evil.

            Currently we still take trx_sys.mutex to serialise ReadView creation.
            This is required to keep serialisation_list ordered by trx->no as well
            as not to let purge thread to create more recent snapshot while another
            thread gets suspended during creation of older snapshot. This will
            become completely mutex free along with serialisation_list removal.

            Compared to previous implementation removing element from rw_trx_hash
            and serialisation_list is not atomic. We disregard all possible bad
            consequences (if there're any) since it will be solved along with
            serialisation_list removal.

            serialisation_list was supposed to instantly give minimum registered
            transaction serialisation number. However maintaining and accessing
            this list requires global mutex protection.

            Since we already take MVCC snapshot by iterating trx_sys_t::rw_trx_hash,
            it is cheap to integrate minimum registered transaction lookup into this
            iteration.
            svoj Sergey Vojtovich made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            svoj Sergey Vojtovich made changes -
            Assignee Sergey Vojtovich [ svoj ] Marko Mäkelä [ marko ]
            Status Confirmed [ 10101 ] In Review [ 10002 ]
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Sergey Vojtovich [ svoj ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            marko Marko Mäkelä made changes -
            svoj Sergey Vojtovich made changes -
            Assignee Sergey Vojtovich [ svoj ] Marko Mäkelä [ marko ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Sergey Vojtovich [ svoj ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            svoj Sergey Vojtovich made changes -
            Fix Version/s 10.3.5 [ 22905 ]
            Fix Version/s 10.3 [ 22126 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Sprint 10.2.13 [ 228 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            svoj Sergey Vojtovich made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 85183 ] MariaDB v4 [ 133456 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -

            People

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