Bug #99339 .idb grows indefenitely (Bug #96466 with REPLACE)
Submitted: 23 Apr 2020 20:22 Modified: 11 Jun 2020 18:01
Reporter: G S Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:8.0.19 OS:Red Hat
Assigned to: CPU Architecture:x86
Tags: regression

[23 Apr 2020 20:22] G S
Description:
It is almost the same bug as described in #96466. We have upgraded our database to MySQL 8.0.19. The tables have at least one column with a mediumBLOB type. Since the upgrade, the .idb files keep increasing despite the number of lines in the tables are still the same. 

How to repeat:
Settings - 
innodb_file_per_table=ON

Same conditions as in #96466, but with REPLACE queries instead of UPDATE.

In production, we're keeping replacing lines with the REPLACE command. Each table has a maximum number of lines and works like a circular buffer. (Use of a modulo in a stored procedure)

=>The disk is full in one day. The use of the OPTIMIZE command is out of question.

Workaround:
Change  "REPLACE INTO.." query into "INSERT INTO ...ON DUPLICATE UPDATE..."

Suggested fix:
#96466 is fixed for UPDATE but not for REPLACE. Release the data when REPLACE is used for the same key.
[24 Apr 2020 6:20] MySQL Verification Team
Hello!

Thank you for the report and feedback.
Verified as described.

regards,
Umesh
[11 Jun 2020 18:01] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 8.0.21 release, and here's the proposed changelog entry from the documentation team:

The lob::purge() function did not free LOBs correctly for an undo log
record type (TRX_UNDO_UPD_DEL_REC) that is generated when an insert
operation modifies a delete-marked record.