Bug #117406 Order of SYNC_EXTENT_PAGES_REQ and UNDO_LOCAL_LCP_FIRST
Submitted: 6 Feb 21:20 Modified: 7 Feb 4:58
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.4.3 OS:Any
Assigned to: CPU Architecture:Any

[6 Feb 21:20] Mikael Ronström
Description:
Order of SYNC_EXTENT_PAGES_REQ and UNDO_LOCAL_LCP_FIRST
.......................................................

It is vital that the write to the UNDO log of the UNDO_LOCAL_LCP_FIRST
is completed before we call SYNC_EXTENT_PAGES_REQ, we accomplish this by
sending an LSN of the UNDO_LOCAL_LCP_FIRST and using the WAL principle
to enforce this condition.
  
Not enforcing this can lead to the following event flow:
1) Sync extent page
2) Write dirty page of table
3) Write UNDO_LOCAL_LCP_FIRST into UNDO log

Using this flow of events means that the extent pages will not see
the write of dirty pages (2 above) and thus the extent pages isn't
sync'ed with the tablespace pages.

The flow of events should be either:
1) Write dirty page of table
2) Write UNDO_LOCAL_LCP_FIRST into UNDO log
3) Sync extent page

OR

1) Write UNDO_LOCAL_LCP_FIRST into UNDO log
2) Write dirty page of table
3) Sync extent page

OR

1) Write UNDO_LOCAL_LCP_FIRST into UNDO log
2) Sync extent page
3) Write dirty page of table

Thus as long as we write UNDO_LOCAL_LCP_FIRST before
synching extent pages we can write dirty pages at any time.

How to repeat:
Found through code review

Suggested fix:
Code mostly follows the correct order, but doesn't wait until UNDO_LOCAL_LCP_FIRST is safe on disk before starting to sync extents.
[7 Feb 4:58] MySQL Verification Team
Hello Mikael,

Thank you for the report and feedback.

Sincerely,
Umesh