mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-33426: Aria temptables wrong thread-specific memory accounting in slave thread
Aria temporary tables account allocated memory as specific to the current THD. But this fails for slave threads, where the temporary tables need to be detached from any specific THD. Introduce a new flag to mark temporary tables in replication as "global", and use that inside Aria to not account memory allocations as thread specific for such tables. Based on original suggestion by Monty. Reviewed-by: Monty <monty@mariadb.org> Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
@@ -203,6 +203,24 @@ a b
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_mode=@old_mode;
|
||||
include/start_slave.inc
|
||||
*** MDEV33426: Memory allocation accounting incorrect for replicated temptable
|
||||
connection server_1;
|
||||
CREATE TEMPORARY TABLE t5 (a int) ENGINE=Aria;
|
||||
CREATE TEMPORARY TABLE t6 (a int) ENGINE=Heap;
|
||||
INSERT INTO t5 VALUES (1);
|
||||
INSERT INTO t6 VALUES (2);
|
||||
connection server_2;
|
||||
include/stop_slave.inc
|
||||
connection server_1;
|
||||
INSERT INTO t1 SELECT a+40, 5 FROM t5;
|
||||
INSERT INTO t1 SELECT a+40, 6 FROM t6;
|
||||
DROP TABLE t5, t6;
|
||||
connection server_2;
|
||||
include/start_slave.inc
|
||||
SELECT * FROM t1 WHERE a>=40 ORDER BY a;
|
||||
a b
|
||||
41 5
|
||||
42 6
|
||||
connection server_2;
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
|
||||
|
Reference in New Issue
Block a user