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

CONNECT engine mysql table type require a table level lock every time when inserting

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: None
    • Labels:
      None

      Description

      It causes the delay on high concurrency insertion.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            bertrandop Olivier Bertrand added a comment -

            Can you elaborate and give an example?
            What are the source and remote table like and what is the insert command?
            Thanks.

            Show
            bertrandop Olivier Bertrand added a comment - Can you elaborate and give an example? What are the source and remote table like and what is the insert command? Thanks.
            Hide
            serg Sergei Golubchik added a comment -

            I suspect the original reporter uses “mysql” table type to connect to an InnoDB table. InnoDB supports row-level locks, so perhaps the CONNECT table that connects to InnoDB might use row-level locks too.

            Currently CONNECT always uses table-level locks, see ha_connect::store_lock. For row-level locks, this method needs to downgrade table locks to TL_WRITE_ALLOW_WRITE, see how complex ha_innobase::store_lock is.

            May be you can do no locking for “mysql” table type at all — and rely on the locks on the underlying table. Or may be not, I'm not sure it'll work.

            Show
            serg Sergei Golubchik added a comment - I suspect the original reporter uses “mysql” table type to connect to an InnoDB table. InnoDB supports row-level locks, so perhaps the CONNECT table that connects to InnoDB might use row-level locks too. Currently CONNECT always uses table-level locks, see ha_connect::store_lock . For row-level locks, this method needs to downgrade table locks to TL_WRITE_ALLOW_WRITE, see how complex ha_innobase::store_lock is. May be you can do no locking for “mysql” table type at all — and rely on the locks on the underlying table. Or may be not, I'm not sure it'll work.
            Hide
            bertrandop Olivier Bertrand added a comment -

            What does FEDERATED about locking? It should be interresting to compare the difference between CONNECT and FEDERATED in high concurrency insertion.

            Show
            bertrandop Olivier Bertrand added a comment - What does FEDERATED about locking? It should be interresting to compare the difference between CONNECT and FEDERATED in high concurrency insertion.
            Hide
            serg Sergei Golubchik added a comment -

            See ha_federatedx::store_lock(). It downgrades the lock to TL_WRITE_ALLOW_WRITE and sometimes to TL_READ.

            Show
            serg Sergei Golubchik added a comment - See ha_federatedx::store_lock() . It downgrades the lock to TL_WRITE_ALLOW_WRITE and sometimes to TL_READ.

              People

              • Assignee:
                bertrandop Olivier Bertrand
                Reporter:
                tramchamploo tramchamploo
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: