Bug #102716 InnoDB blob pages may be lost after import tablespace
Submitted: 24 Feb 2021 3:29 Modified: 9 Mar 2021 1:19
Reporter: Shaohua Wang (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[24 Feb 2021 3:29] Shaohua Wang
Description:
since we disable purge when exporting tablespace, we do index purge in importing tablespace, just for delete marked records. Suppose we update a blob column(stored externally), the old blob ref will be in undo withtout purge. We miss the old blob ref in imporint tablespace, so the pages used by old blob ref will not be purged(recycled) except table rebuild.

How to repeat:
code investigation

Suggested fix:
two candidates:
1. wait for purge to finish when exporting tablespace;
2. update document to record it as limitation.
[24 Feb 2021 13:24] MySQL Verification Team
Hi Mr. Wang,

Thank you for your bug report.

However, it is not clear to us, whether you are complaining on the size of the imported tablespaces or that the blob pages have really been lost ???

In any case, we do require a fully repeatable test case on the latest release.
[8 Mar 2021 12:18] Shaohua Wang
Test case attached.

we will see in the result:
1. discard without blob purged:
t1 size : 15728640
t2 size : 20971520 --unpurge blobl space lost!!!

2. discard waiting for blob purged:
t1 size : 15728640
t2 size : 15728640 --purged blob space resued!!!
[8 Mar 2021 12:19] Shaohua Wang
test case

Attachment: import_table_without_blob_purged.test (application/octet-stream, text), 2.91 KiB.

[8 Mar 2021 13:45] MySQL Verification Team
Thank you, Mr. Wang,

This is indeed a bug that is easy to report.

It, however, remains to be seen whether it is a bug in the documentation or in the code.

Verified as a code bug, for the time being.
[9 Mar 2021 1:19] Shaohua Wang
I run the test in 8.0, so it's also a bug for 8.0.
[9 Mar 2021 13:28] MySQL Verification Team
Thank you, Mr. Wang,

This fact has been already recorded in our internal bug system.