facebook / mysql-5.6

Facebook's branch of the Oracle MySQL database. This includes MyRocks.
http://myrocks.io
Other
2.48k stars 714 forks source link

Handle log archiver archiving past the clone SE sync point #1328

Closed laurynas-biveinis closed 1 year ago

laurynas-biveinis commented 1 year ago

Under write workload, it is possible for the InnoDB log archiver to archive log data past the clone SE synchronization point LSN, with the following thread interleaving:

1) Clone SE synchronization executes the performance_schema.LOG_STATUS query 2) User query performs a write to InnoDB, advancing the LSN 3) InnoDB log archiver archives the log written in the previous step 4) Clone SE synchronization asks the InnoDB log archiver to stop archiving at the clone LSN, which is less than the already-archived LSN.

It was assumed that this scenario cannot happen, thus code hits various asserts, and on the release build may continue archiving indefinitely.

Since the log archiver already has support for providing less log data than archived, fix by setting the log archiver stop LSN correctly to smaller of SE synchronization and already-archived LSN.

Add a DEBUG_SYNC-using testcase.

facebook-github-bot commented 1 year ago

@sunshine-Chun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 1 year ago

@laurynas-biveinis has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot commented 1 year ago

@sunshine-Chun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.