MDEV-31273: Refactor MYSQL_BIN_LOG::write_cache()
Preparatory patch for pre-computing binlog checksums outside of holding LOCK_log. The existing code for MYSQL_BIN_LOG::write_cache() was needlessly complex and very hard to understand and modify for handling the new case where pre-computed checksums are already present in the IO_CACHE. Greatly simplify the logic by replacing the (implicit) state machine with direct code that pulls the events one by one from the IO_CACHE. This removes a lot of state flags and avoids duplicate code for handling full vs. split headers. This also removes the need for the CacheWriter class. As a bonus, this fixes the bug that CacheWriter::write() was completely ignoring write errors. No other functional changes are done with this patch, only code cleanup. Reviewed-by:Monty <monty@mariadb.org> Signed-off-by:
Kristian Nielsen <knielsen@knielsen-hq.org>
Showing
Please register or sign in to comment