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

On slave XA COMMIT/XA ROLLBACK fail to return an error in read-only mode

    XMLWordPrintable

Details

    Description

      On slave , Non-super users can able to execute XA COMMIT/XA ROLLBACK.
      slave fails to return an error in read-only mode. It causes the slave to break replication when gtid_strict_mode is enabled.

      On Master:

      MariaDB [test]> select @@read_only;
      +-------------+
      | @@read_only |
      +-------------+
      |           0 |
      +-------------+
      1 row in set (0.000 sec)
      MariaDB [test]> XA START 'MyXA';
      Query OK, 0 rows affected (0.001 sec)
       
      MariaDB [test]> INSERT INTO test.t1 VALUES(1);
      Query OK, 1 row affected (0.001 sec)
       
      MariaDB [test]> XA END 'MyXA';
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> XA PREPARE 'MyXA';
      Query OK, 0 rows affected (0.003 sec)
      

      On slave:

      MariaDB [(none)]> select @@read_only;
      +-------------+
      | @@read_only |
      +-------------+
      |           1 |
      +-------------+
      1 row in set (0.001 sec)
       
      MariaDB [test]> show grants;
      +---------------------------------------------------------------------------------------------------------+
      | Grants for app_user@%                                                                                   |
      +---------------------------------------------------------------------------------------------------------+
      | GRANT USAGE ON *.* TO "app_user"@"%" IDENTIFIED BY PASSWORD '*8232A1298A49F710DBEE0B330C42EEC825D4190A' |
      | GRANT SELECT, INSERT, UPDATE, DELETE ON "test".* TO "app_user"@"%"                                      |
      +---------------------------------------------------------------------------------------------------------+
      2 rows in set (0.001 sec)
       
      MariaDB [(none)]> XA COMMIT 'MyXA';
      Query OK, 0 rows affected (0.004 sec)
      
      

      on Slave:

       
      MariaDB [test]> select @@read_only;
      +-------------+
      | @@read_only |
      +-------------+
      |           1 |
      +-------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> show grants;
      +---------------------------------------------------------------------------------------------------------+
      | Grants for app_user@%                                                                                   |
      +---------------------------------------------------------------------------------------------------------+
      | GRANT USAGE ON *.* TO "app_user"@"%" IDENTIFIED BY PASSWORD '*8232A1298A49F710DBEE0B330C42EEC825D4190A' |
      | GRANT SELECT, INSERT, UPDATE, DELETE ON "test".* TO "app_user"@"%"                                      |
      +---------------------------------------------------------------------------------------------------------+
      2 rows in set (0.001 sec)
       
      MariaDB [test]> XA ROLLBACK 'MyXA';
      Query OK, 0 rows affected (0.005 sec)
      
      

      Attachments

        Activity

          People

            bnestere Brandon Nesterenko
            pandi.gurusamy Pandikrishnan Gurusamy
            Votes:
            1 Vote for this issue
            Watchers:
            6 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.