欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

slave_pending_jobs_size_max

程序员文章站 2024-01-12 09:33:28
...

自己的复制环境(5.7.10)还没有使用并发复制,所以想尝试一下 :

原参数如下:

| slave_parallel_type          | DATABASE                      |
| slave_parallel_workers       | 0                             |

将参数更改如下:

| slave_parallel_type          | LOGICAL_CLOCK                 |
| slave_parallel_workers       | 4                            |

两天后,备库遇到了一个错误:

[[email protected] data]# cat  localhost.localdomain.err | grep 'Cannot schedule' | more
2018-06-23T01:52:06.212083Z 1284585 [ERROR] Slave SQL for channel 'semir_33': Cannot schedule event Query, relay-log name ./localhost-relay-bin-semir_33.0337
54, position 969425791 to Worker thread because its size 19800765 exceeds 16777216 of slave_pending_jobs_size_max. Error_code: 1864
2018-06-23T01:52:06.212142Z 1284585 [Warning] Slave: Cannot schedule event Query, relay-log name ./localhost-relay-bin-semir_33.033754, position 969425791 to
 Worker thread because its size 19800765 exceeds 16777216 of slave_pending_jobs_size_max. Error_code: 1864

好像是说数据超过了 slave_pending_jobs_size_max 的最大值,查看从库参数当前值,确实是16777216 ,改成 29999104 ,备库能够正常起来了 。

[email protected] :(none)12:00:11>show variables like 'slave_pending_jobs_size_max';
+-----------------------------+----------+
| Variable_name               | Value    |
+-----------------------------+----------+
| slave_pending_jobs_size_max | 16777216 |
+-----------------------------+----------+

但是还发现一个问题,有很多note 的信息,并且复制的速度并没有什么提升,暂时改回去了

2018-06-26T02:55:26.836074Z 1285873 [Note] Multi-threaded slave statistics for channel 'semir_33': seconds elapsed = 120; events assigned = 138388481; worker queues filled over overrun level = 14564; waited due a Worker queue full = 0; waited due the total size = 39834; waited at clock conflicts = 94796032330100 waited (count) when Workers occupied = 206047 waited when Workers occupied = 6291101300
2018-06-26T02:59:25.314146Z 1285873 [Note] Multi-threaded slave statistics for channel 'semir_33': seconds elapsed = 239; events assigned = 138404865; worker queues filled over overrun level = 14564; waited due a Worker queue full = 0; waited due the total size = 39834; waited at clock conflicts = 95034306234300 waited (count) when Workers occupied = 206047 waited when Workers occupied = 6291101300
2018-06-26T03:01:43.792496Z 1285873 [Note] Multi-threaded slave statistics for channel 'semir_33': seconds elapsed = 138; events assigned = 138508289; worker queues filled over overrun level = 14564; waited due a Worker queue full = 0; waited due the total size = 39834; waited at clock conflicts = 95171245248000 waited (count) when Workers occupied = 206047 waited when Workers occupied = 6291101300