mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-28561 Assertion failed: !pfs->m_idle || (state == PSI_SOCKET_STATE_ACTIVE)
The error was specific to threadpool/compressed protocol. set_thd_idle() set socket state to idle twice, causing assert failure. This happens if unread compressed data on connection,after query was finished. On a protocol level, this means a single compression packet contains multiple command packets.
This commit is contained in:
@ -124,12 +124,17 @@ static void re_init_net_server_extension(THD *thd)
|
||||
|
||||
#endif /* HAVE_PSI_INTERFACE */
|
||||
|
||||
static inline bool has_unread_compressed_data(const NET *net)
|
||||
{
|
||||
return net->compress && net->remain_in_buf;
|
||||
}
|
||||
|
||||
static inline void set_thd_idle(THD *thd)
|
||||
{
|
||||
thd->net.reading_or_writing= 1;
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
net_before_header_psi(&thd->net, thd, 0);
|
||||
if (!has_unread_compressed_data(&thd->net))
|
||||
net_before_header_psi(&thd->net, thd, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -326,10 +331,8 @@ static void handle_wait_timeout(THD *thd)
|
||||
static bool has_unread_data(THD* thd)
|
||||
{
|
||||
NET *net= &thd->net;
|
||||
if (net->compress && net->remain_in_buf)
|
||||
return true;
|
||||
Vio *vio= net->vio;
|
||||
return vio->has_data(vio);
|
||||
return vio->has_data(vio) || has_unread_compressed_data(net);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user