mirror of
https://github.com/MariaDB/server.git
synced 2025-07-05 12:42:17 +03:00
MDEV-6156: Parallel replication incorrectly caches charset between worker threads
The previous patch for this bug was unfortunately completely wrong. The purpose of cached_charset is to remember which character set we have installed currently in the THD, so that in the common case where charset does not change between queries, we do not need to update it in the THD. Thus, it is important that the cached_charset field is tightly coupled to the THD for which it handles caching. Thus the right place to put cached_charset seems to be in the THD. This patch introduces a field THD:system_thread_info where such info in general can be placed without further inflating the THD with unused data for other threads (THD is already far too big as it is). It then moves the cached_charset into this slot for the SQL driver thread and for the parallel replication worker threads. The THD::rpl_filter field is also moved inside system_thread_info, to keep the size of THD unchanged. Moving further fields in to reduce the size of THD is a separate task, filed as MDEV-6164.
This commit is contained in:
@ -72,6 +72,8 @@ class Parser_state;
|
||||
class Rows_log_event;
|
||||
class Sroutine_hash_entry;
|
||||
class user_var_entry;
|
||||
class rpl_io_thread_info;
|
||||
class rpl_sql_thread_info;
|
||||
|
||||
enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME };
|
||||
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };
|
||||
@ -1810,8 +1812,10 @@ public:
|
||||
/* Slave applier execution context */
|
||||
rpl_group_info* rgi_slave;
|
||||
|
||||
/* Used to SLAVE SQL thread */
|
||||
Rpl_filter* rpl_filter;
|
||||
union {
|
||||
rpl_io_thread_info *rpl_io_info;
|
||||
rpl_sql_thread_info *rpl_sql_info;
|
||||
} system_thread_info;
|
||||
|
||||
void reset_for_next_command();
|
||||
/*
|
||||
|
Reference in New Issue
Block a user