type
status
date
slug
summary
tags
category
icon
password
說明
在 SHOW PROCESSLIST 中即使 replaction 沒有延遲,Slave 的 SQL 線程中的 INFO 資訊有時候仍會顯示應用的最後一個查詢,並且會持續到應用下一個查詢出現之前。
復現過程
首先建立一組 M-S,之後在 Master 上執行:
到 Slave 使用 SHOW PROCESSLIST 查看結果:
可以看到 system user 裡 STATE 為
Slave has read all relay log; waiting for more updates
表示 SQL THREAD 已經執行完畢該語法正在等待新的 relay log,但是 CREATE USER
語法卻仍舊顯示在 INFO 裡,而且只要 Master 不執行新的語法就會一直顯示。接下來讓我們回到 Master 執行一個 CREATE DATABASE:
到 Slave 使用 SHOW PROCESSLIST 查看結果:
可以發現剛剛出現在 INFO 裡的語法不見了。
修復版本
Replication: The output of a SHOW PROCESSLIST statement for a replica’s SQL thread sometimes showed the last query as currently being applied when the replica was actually caught up. (Bug #30521198, Bug #97560)