Bug #112002 opt_replication_sender_observe_commit_only is not honored for XA ROLLBACK
Submitted: 9 Aug 2023 6:08 Modified: 9 Aug 2023 6:22
Reporter: Venkatesh Prasad Venugopal (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.23+ OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution, semisync

[9 Aug 2023 6:08] Venkatesh Prasad Venugopal
Description:
The server variable opt_replication_sender_observe_commit_only is not honored for XA ROLLBACK command because of the typo error in https://github.com/mysql/mysql-server/blob/057f5c9509c6c9ea3ce3acdc619f3353c09e6ec6/sql/rp...

=== TYPO BEGIN ===
            m_to_set = (strncmp("XA COMMIT", ev.query, 9) == 0) ||
                       (strncmp("XA ABORT", ev.query, 8) == 0) ||
                       (strncmp("COMMIT", ev.query, 6) == 0);
          break;
=== TYPO END ===

In the above code block, the command is compared against "XA ABORT", but it is not a valid query in MySQL.

How to repeat:
Examine the definition of Observe_transmission_guard class in sql/rpl_binlog_sender.cc.

Suggested fix:
Change XA ABORT to XA ROLLBACK
[9 Aug 2023 6:12] Venkatesh Prasad Venugopal
Contribution patch to fix the issue based on 8.0.34 code

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: Bug#112002_8.0.34.diff (text/x-patch), 1.03 KiB.

[9 Aug 2023 6:22] MySQL Verification Team
Hello Venu,

Thank you for the report and contribution.

regards,
Umesh