Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 2.2.5
    • 2.2.6
    • readconnroute
    • None
    • RHEL 7
      JBoss 6.1
      Java 6
      mariadb-java-client-1.7.3.jar
      MariaDB 10.2.13
    • MXS-SPRINT-58

    Description

      Hi there,

      I'm in simple setup. Two hosts: one master, one slave. All requests (W/R) are forwarded to the master.

      Here is my config:

      [maxscale]
      threads=auto
      logdir=/var/log/maxscale/
      piddir=/var/run/maxscale/
       
      [xxx1]
      type=server
      address=192.168.82.1
      port=3306
      protocol=MariaDBBackend
      serv_weight=1
       
      [xxxx2]
      type=server
      address=192.168.3.1
      port=3306
      protocol=MariaDBBackend
      serv_weight=0
       
      [MariaDB-Monitor]
      type=monitor
      module=mariadbmon
      servers=xxxx1,xxxx2
      user=xxx
      passwd=xxx
      monitor_interval=2000
      auto_failover=true
      detect_standalone_master=true
      auto_rejoin=true
      replication_user=replicator
      replication_password=xxxx
       
      [Readconn-Router-Service]
      type=service
      router=readconnroute
      servers=xxxx1,xxxx2
      router_options=master
      user=maxboy
      passwd=xxxx
      weightby=serv_weight
       
      [MaxAdmin-Service]
      type=service
      router=cli
       
      [CLI]
      type=service
      router=cli
       
      [RRS-Listener]
      type=listener
      service=Readconn-Router-Service
      protocol=MariaDBClient
      port=3306
      address=127.0.0.1
       
      [MaxAdmin-Listener]
      type=listener
      service=MaxAdmin-Service
      protocol=maxscaled
      socket=default
       
      [CLI Listener]
      type=listener
      service=CLI
      protocol=maxscaled
      address=localhost
      port=6603
      

      When executing a batch of prepared statements from my application, I encounter a JAVA Exception.

      You will find the Exception as an attachment.

      Attachments

        Activity

          BobSauvage Bob Sauvage added a comment -

          I've activated all logs in MaxScale. I cannot see the prepared statement.

          I've activate the general_log in MariaDB, I see the prepared statement:

          Prepare insert into JBPM_BYTEBLOCK (PROCESSFILE_, INDEX_, BYTES_) values (?, ?, ?)

          I've activated slow log on MariaDB (>0), I don't see the request with the parameters... While I see it when by passing MaxScale...

          BobSauvage Bob Sauvage added a comment - I've activated all logs in MaxScale. I cannot see the prepared statement. I've activate the general_log in MariaDB, I see the prepared statement: Prepare insert into JBPM_BYTEBLOCK (PROCESSFILE_, INDEX_, BYTES_) values (?, ?, ?) I've activated slow log on MariaDB (>0), I don't see the request with the parameters... While I see it when by passing MaxScale...
          markus makela markus makela added a comment -

          Possibly a problem with batch execution of statements. Adding useBatchMultiSend=false to the connection string would verify this.

          markus makela markus makela added a comment - Possibly a problem with batch execution of statements. Adding useBatchMultiSend=false to the connection string would verify this.
          BobSauvage Bob Sauvage added a comment - - edited

          @markus makela Thanks for your quick reply

          I've added the option like this in the configuration of my datasource in JBoss:

          <connection-url>jdbc:mariadb://127.0.0.1:3306/MyDB?useBatchMultiSend=false</connection-url>

          but it is not working better :/

          I'm surprized that the option does not appear in the boot.log. Normal ?

          Thanks,

          Bob

          BobSauvage Bob Sauvage added a comment - - edited @markus makela Thanks for your quick reply I've added the option like this in the configuration of my datasource in JBoss: <connection-url>jdbc:mariadb://127.0.0.1:3306/MyDB?useBatchMultiSend=false</connection-url> but it is not working better :/ I'm surprized that the option does not appear in the boot.log. Normal ? Thanks, Bob
          markus makela markus makela added a comment - - edited

          If you add version_string=10.1.30-fake-version to the service, does it fix it?

          The likely cause is the fact that MaxScale 2.2 does not treat the COM_STMT_BULK_EXECUTE correctly.

          markus makela markus makela added a comment - - edited If you add version_string=10.1.30-fake-version to the service, does it fix it? The likely cause is the fact that MaxScale 2.2 does not treat the COM_STMT_BULK_EXECUTE correctly.
          BobSauvage Bob Sauvage added a comment - - edited

          @Markus Makela

          Have I to add it to maxscale.cnf ?

          [maxscale]
          ...
          version_string=10.1.30-fake-version

          If yes, the error continues to appear:

          ERROR hibernate flush failed: org.hibernate.exception.JDBCConnectionException: Could not execute JDBC batch update

          Have I to test another version of Maxscale ?

          BobSauvage Bob Sauvage added a comment - - edited @Markus Makela Have I to add it to maxscale.cnf ? [maxscale] ... version_string=10.1.30-fake-version If yes, the error continues to appear: ERROR hibernate flush failed: org.hibernate.exception.JDBCConnectionException: Could not execute JDBC batch update Have I to test another version of Maxscale ?
          BobSauvage Bob Sauvage added a comment -

          Markus,

          It's working, thanks a lot !

          The parameter was to add in the service section.

          Do you know if I risk to encounter other issues during failover due to this "bug" ?

          In order to remove this parameter safely, have I to wait a new release of MaxScale ?

          Again, thanks for your support.

          BobSauvage Bob Sauvage added a comment - Markus, It's working, thanks a lot ! The parameter was to add in the service section. Do you know if I risk to encounter other issues during failover due to this "bug" ? In order to remove this parameter safely, have I to wait a new release of MaxScale ? Again, thanks for your support.
          markus makela markus makela added a comment -

          The new style of bulk insert/update added for the 10.2.7 release of MariaDB is not currently supported by MaxScale (it doesn't treat it as a prepared statement command). Using a version string of an older release guarantees that the connector (if it's smart enough) won't use this new command. The connector can also be configured to not use this command by adding useBulkStmts=false but this has to be done on all clients that use MaxScale.

          Given that this appears to be a relatively simple bug to fix so I would assume it'll be a part of either the next 2.2 release or the one after that. MaxScale versions prior to 2.2 should work with this as they don't load balance prepared statements and hence don't really care about "unknown" commands (they are treated as if they were writes →they are routed to the master).

          markus makela markus makela added a comment - The new style of bulk insert/update added for the 10.2.7 release of MariaDB is not currently supported by MaxScale (it doesn't treat it as a prepared statement command). Using a version string of an older release guarantees that the connector (if it's smart enough) won't use this new command. The connector can also be configured to not use this command by adding useBulkStmts=false but this has to be done on all clients that use MaxScale. Given that this appears to be a relatively simple bug to fix so I would assume it'll be a part of either the next 2.2 release or the one after that. MaxScale versions prior to 2.2 should work with this as they don't load balance prepared statements and hence don't really care about "unknown" commands (they are treated as if they were writes →they are routed to the master).
          BobSauvage Bob Sauvage added a comment -

          Thanks a lot for your complete answer and the time you took to explain me the issue and the future actions.

          BobSauvage Bob Sauvage added a comment - Thanks a lot for your complete answer and the time you took to explain me the issue and the future actions.

          People

            markus makela markus makela
            BobSauvage Bob Sauvage
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.