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

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

          As far as I can see, the test case (or the basic idea behind it) in the issue Description.

          valerii Valerii Kravchuk added a comment - As far as I can see, the test case (or the basic idea behind it) in the issue Description.
          Elkin Andrei Elkin added a comment -

          Also see a somewhat related MDEV-13437, which backs up the correct polity, to implement.

          Elkin Andrei Elkin added a comment - Also see a somewhat related MDEV-13437 , which backs up the correct polity, to implement.

          Hi Andrei!

          This is ready for review as PR-2678.

          bnestere Brandon Nesterenko added a comment - Hi Andrei! This is ready for review as PR-2678 .

          Pushed into 10.5 as 9808ebe19.

          No merge conflicts/test failures observed through manual cherry picking into 11.2.

          bnestere Brandon Nesterenko added a comment - Pushed into 10.5 as 9808ebe19 . No merge conflicts/test failures observed through manual cherry picking into 11.2.

          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.