WL#8599: Reduce contention in IO and SQL threads

Affects: Server-8.0   —   Status: Complete

With 5.7 MTS the replication slave is able to execute more transactions
than the master, even on write-only workloads, as long as the SQL thread
is running without the IO thread.

If the IO thread is active reading the relay log from the master the
overhead can reach 60%, which eats up a lot of the benefit from a more
efficient MTS scheduler.  This seems to be caused by contention on the
MYSQL_RELAY_LOG::LOCK_log.

The main goal (G1) of this worklog is to reduce the contention between
receiver (a.k.a. I/O) and applier (a.k.a. SQL) replication threads.

Other References
----------------

BUG#77778: TUNING THE LOG_LOCK CONTENTION FOR IO_THREAD AND SQL_THREAD IN
RPL_SLAVE.CC