Bug #107271 XA transaction engine binlog pos info reset
Submitted: 12 May 2022 11:46 Modified: 14 Jun 2022 12:11
Reporter: bin wang (OCA) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[12 May 2022 11:46] bin wang
Description:
 engine   binlog position is only set in commmit flush (ordered_commit 
 =>process_flush_stage_queue=>flush_thread_caches=>set_trans_pos).
 But some transactions can not go through them (such as table copy in DDL).
  

 
   

How to repeat:

 when a DDL statement implicitly commits earlier transaction ,then starting a new one, the new transaction will be "leaking" the  binlog pos, and may  overwrite binlog position with previous location, in order to avoid this ,need reset it here.
   

Suggested fix:
mysql-8.0.28\sql\binlog.cc 
 } else if (!skip_commit) {
 ++    /* 
 ++    in order to avoid the new transaction will be "leaking" the  binlog pos, and may  overwrite binlog position with previous location  ,need reset it here.
 ++    */
 ++ 	thd->set_trans_pos(nullptr, 0);
    if (ha_commit_low(thd, all)) return RESULT_INCONSISTENT;
  }
[12 May 2022 13:42] MySQL Verification Team
Hi Mr. wang,

Thank you very much for your bug report.

However, your report does not have all the info we require.

First of all, your report is titled that it refers to XA transactions, while the text clearly depicts that it is tangent to all kinds of transactions within the MVCC environment.

Next, your explanation of the phenomena is insufficient. We do need more detailed description as well as the justification for your patch. For which we thank you, of course ....

Last , but not least, we do require a precise test case that will enable us to reproduce the issue reliably and justify your patch. Do note that our test system has means to synchronise events within the concurrent transactions. You can use those for your test case.

We are eagerly waiting on all of the feedback that we described above .....
[13 Jun 2022 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[14 Jun 2022 12:11] MySQL Verification Team
We can't repeat the behaviour without a proper test case.