Bug #106184 Restart with more than 64k extents in a fragment can fail
Submitted: 17 Jan 2022 12:52 Modified: 17 Jan 2022 18:49
Reporter: Mikael Ronström Email Updates:
Status: Verified Impact on me:
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:8.0.27 OS:Any
Assigned to: CPU Architecture:Any

[17 Jan 2022 12:52] Mikael Ronström
TSMAN handles extents
DBTUP receive information about an allocated extent and uses this
information to print debug information.

There is however one use case where the extent_no stored in DBTUP is used to
find the extent. This is in restart_setup_page. This function uses the extent_no
to search in the hash in DBTUP. Since the extent_no in DBTUP is stored in a 16-bit
variable it means that with more than 64k extents in a fragment we will have more
than one entry in the hash table with the same hash key. Thus the extent we lookup
in the hash table could potentially be the wrong extent.

How to repeat:
Found through code inspection.

But create TABLESPACE with small extent size, e.g. 1 MB. Then create a data file
which has more 64k extents. Thus e.g. 256 GB => 256k extents.
Finally create a table with 1 partition.

Next run some benchmark against the table that ensures that we get lots of writes
to all sorts of pages.

Not sure what problems one will see though.

Suggested fix:
Ensure that extent_no is stored in DBTUP in 32-bit variable, thus cannot be stored
in Local_key.
[17 Jan 2022 18:49] MySQL Verification Team
Hi Mikael, 
Thanks for the report.

all best