- Should Relay_log_info::purge_relay_logs set errmsg on failure to
acquire binlog lock protection?
- Why does Slave_worker::reset_recovery_info try to acquire the
binlog protection and proceeds to call the setter without
considering whether the acquisition succeeded? That will fail
the DBUG_ASSERT in the setter in the case of failure at
least. If I understand the context of the code correctly, it
should be just like the other protection sites instead, with an
early error return in the case of failure.
- Should Relay_log_ info::purge_ relay_logs set errmsg on failure to
acquire binlog lock protection?
- Why does Slave_worker: :reset_ recovery_ info try to acquire the
binlog protection and proceeds to call the setter without
considering whether the acquisition succeeded? That will fail
the DBUG_ASSERT in the setter in the case of failure at
least. If I understand the context of the code correctly, it
should be just like the other protection sites instead, with an
early error return in the case of failure.
- Have you considered extracting
bool rpl_acquire_ backup_ binlog_ lock_protection (thd, rli) binlog_ lock.is_ acquired( )) >variables. lock_wait_ timeout;
{
bool ret= true;
if (thd && !thd->backup_
{
const ulong timeout= info_thd-
DBUG_ PRINT(" debug", ("Acquiring binlog protection lock"));
if (rli) mutex_assert_ not_owner( &rli->data_ lock);
mysql_
ret= !info_thd- >backup_ binlog_ lock.acquire_ protection( thd,
MDL_EXPLICIT, timeout);
}
return ret;
}
and void release(thd, bool protection_ acquired) PRINT(" debug", ("Releasing binlog protection lock")); >backup_ binlog_ lock.release_ protection( thd);
{
if (thd && prot_acquired)
{
DBUG_
thd-
}
}