One thread may successfully call "xlock()" and set "snapshot_lock_acquired" to "true" whereas another one may call the same "xlock()" method and end up in "DBUG_ASSERT(!snapshot_lock_acquired);" assertion.
The fix would be in putting "DBUG_ASSERT(!snapshot_lock_acquired);" after "mysql_mutex_lock(&LOCK_log);"
Although I did not manage to reproduce this on 5.6 (commit f3f9359). The potential problem seems to be with the following method in "binlog.cc".
void MYSQL_BIN_ LOG::xlock( void) ASSERT( !snapshot_ lock_acquired) ;
{
DBUG_
mysql_ mutex_lock( &LOCK_log) ;
if (opt_binlog_ order_commits) mutex_lock( &LOCK_commit) ; lock_acquired= true; rwlock_ wrlock( &LOCK_consisten t_snapshot) ;
{
mysql_
}
else
{
snapshot_
mysql_
}
}
One thread may successfully call "xlock()" and set "snapshot_ lock_acquired" to "true" whereas another one may call the same "xlock()" method and end up in "DBUG_ASSERT( !snapshot_ lock_acquired) ;" assertion.
The fix would be in putting "DBUG_ASSERT( !snapshot_ lock_acquired) ;" after "mysql_ mutex_lock( &LOCK_log) ;"