Commit 1701ee33 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-4113: Assertion (group->connection_count > 0) fails with Percona server in replication test.

Assertion happens in replication thread during THD destruction, when thread calls my_sync(), which in turn calls  thd_wait_begin() callback. Connection count can be 0, because the counter was decremented before THD destructor. 
This assertion currently reproducible only in Percona server  and not in MariaDB, due to differences in replication code.

Fixed by moving  code to decrement connection counter after the THD destructor.
parent 52fbe44f
......@@ -1247,11 +1247,12 @@ static void connection_abort(connection_t *connection)
DBUG_ENTER("connection_abort");
thread_group_t *group= connection->thread_group;
threadpool_remove_connection(connection->thd);
mysql_mutex_lock(&group->mutex);
group->connection_count--;
mysql_mutex_unlock(&group->mutex);
threadpool_remove_connection(connection->thd);
my_free(connection);
DBUG_VOID_RETURN;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment