Bug #105765 Completion of scan of previously Dropped tables can cause a crash
Submitted: 1 Dec 2021 13:47 Modified: 2 Dec 2021 3:29
Reporter: Mikael Ronström Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:8.0.27 OS:Any
Assigned to: CPU Architecture:Any

[1 Dec 2021 13:47] Mikael Ronström
Description:
When dropping a table, the table is dropped after a timeout, after this timeout
there could be still be scans ongoing. These will be  return with an error, but
as part of this error processing they will call complete_scan_on_table.
If the table id has been reused since then the m_scan_count will become
inconsistent which will lead to it becoming negative. This will cause issues
when performing a future ALTER TABLE.

How to repeat:
Some autotest test case, don't recall which

Suggested fix:
Ensure that scans that start receive information about schema version they used
when starting the scan. Ignore complete scans where the major schema version bits
(the 24 least significant bits) have changed since start of the scan. This indicates
that the table was dropped.
[2 Dec 2021 3:29] MySQL Verification Team
Thanks for the report Mikael.

kind regards
Bogdan