Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-5302

Prepared statements should never be removed from session command history

    XMLWordPrintable

Details

    Description

      If a client prepares more prepared statements than can fit into max_sescmd_history, they get pruned off due to them being treated as normal session commands. This causes a problem where a reconnection inside MaxScale to one of the backend servers will cause some number of open prepared statements to be lost which will cause Unknown prepared statement handler errors in MaxScale.

      The workaround that has been documented is to increase max_sescmd_history to a high enough of a value that all of the stored prepared statements fit into it plus some overhead for whatever SET command the program may execute. However, while this is something that can be avoided by correctly configuring MaxScale, it's not something that the end user should ever have to care about as it's very deep in the protocol level of how things work: it breaks the principle of MaxScale behaving exactly like MariaDB.

      The solution to this is to not treat prepared statements as something that need to follow the limit of max_sescmd_history and only remove then when the corresponding COM_STMT_CLOSE arrives.

      Attachments

        Activity

          People

            markus makela markus makela
            markus makela markus makela
            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.