Bug #112178 Transaction inconsistency when the undo space truncate is incomplete
Submitted: 25 Aug 2023 3:38 Modified: 25 Aug 2023 14:07
Reporter: shang kevin Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.34 OS:Any
Assigned to: CPU Architecture:Any
Tags: truncate, undo space

[25 Aug 2023 3:38] shang kevin
Description:
During the undo space truncating, if the system crashes just after activating the new undo space and before done logging, meanwhile some transactions using the new undo space, these active transactions will not be rolled back after system restart, and the deleted rows could not be purge.

How to repeat:
1.Sleep for 30 seconds in the processing logic of ib_undo_trunc_before_done_logging
2.SET GLOBAL DEBUG = "+d,ib_undo_trunc_before_done_logging"
3.Start some update transactions and do not commit
4.Wait for the system to exit and restart
5.The transactions in step 3 becomes committed

Suggested fix:
Done logging before activate the new undo space.
[25 Aug 2023 14:07] MySQL Verification Team
Hi Mr. kevin,

Thank you for your bug report.

Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.mysql.com/how-to-report.php 

If you can provide sufficient  information, we shall continue to process your report.

Full test case should consist of the set of SQL statements that will always lead to the problem that you are reporting.

We also accept a report based on the code analysis, but in that case, you should point exactly where the error is in our code, with a proposed patch.

Thank you for your interest in MySQL.