Quantcast
Channel: 日々の覚書
Viewing all articles
Browse latest Browse all 581

MySQLのシノニムではないけど同じような動きをする何か(と、SHOW SLAVE STATUSとSHOW REPLICA STATUSの地味な違い)

$
0
0

TL;DR


実装上はシノニムになっていないけれど、同じ(ような)動きをする何かたち。

その1その2扱い
MASTER, SLAVE系SOURCE, REPLICA系sql/sql_yacc.yyの中で丸められている
{SHOW|PURGE} BINARY LOGS{SHOW|PURGE} MASTER LOGS同上
SERIALBIGINT UNSIGNED NOT NULL AUTO_INCREMENTPT_serial_typeの中で BIGINT UNSIGNED NOT NULL AUTO_INCREMENT属性に上書きしてる
複合SQLモードexpand_sql_modeの中でベースのsql_modeの羅列に展開
repl_semi_sync_{master|slave}repl_semi_sync_{source|replica}実は違う.soファイル(ソースはほぼ一緒)
$ ll /usr/mysql/8.0.29/lib/plugin/*semi*
-rwxr-xr-x 1 yoku0825 yoku0825 239040 Apr 26 20:08 /usr/mysql/8.0.29/lib/plugin/semisync_master.so
-rwxr-xr-x 1 yoku0825 yoku0825 79896 Apr 26 20:08 /usr/mysql/8.0.29/lib/plugin/semisync_replica.so
-rwxr-xr-x 1 yoku0825 yoku0825 80696 Apr 26 20:08 /usr/mysql/8.0.29/lib/plugin/semisync_slave.so
-rwxr-xr-x 1 yoku0825 yoku0825 238136 Apr 26 20:08 /usr/mysql/8.0.29/lib/plugin/semisync_source.so

$ ll ~/mysql-8.0.plugin/semisync/*.cc
-rw-r--r-- 1 yoku0825 yoku0825 2306 Mar 23 22:52 plugin/semisync/semisync.cc
-rw-r--r-- 1 yoku0825 yoku0825 5416 Mar 23 22:52 plugin/semisync/semisync_replica.cc
-rw-r--r-- 1 yoku0825 yoku0825 12620 Mar 23 22:52 plugin/semisync/semisync_replica_plugin.cc
-rw-r--r-- 1 yoku0825 yoku0825 1218 Mar 23 22:52 plugin/semisync/semisync_replica_plugin_old.cc
-rw-r--r-- 1 yoku0825 yoku0825 42647 Mar 23 22:52 plugin/semisync/semisync_source.cc
-rw-r--r-- 1 yoku0825 yoku0825 10554 Mar 23 22:52 plugin/semisync/semisync_source_ack_receiver.cc
-rw-r--r-- 1 yoku0825 yoku0825 28669 Mar 23 22:52 plugin/semisync/semisync_source_plugin.cc
-rw-r--r-- 1 yoku0825 yoku0825 1217 Mar 23 22:52 plugin/semisync/semisync_source_plugin_old.cc

他に何かあったっけなあ…? あったら教えてください :bow:


おまけ。

丸められているは丸められているんだけど、 SHOW SLAVE STATUSSHOW REPLICA STATUSは互換性のために「どちらのステートメントで呼ばれたか」によって返すカラムの名前を正規表現で置換していて、 SHOW SLAVE STATUSの方を使ってしまうとCPUオーバーヘッドが乗るらしい。

slave1 [localhost] {msandbox} ((none)) > SHOW SLAVE STATUS\G
Slave_IO_State: Waiting for source to send event
Slave_IO_Running: Yes
Last_IO_Errno: 0
Last_IO_Error:
Last_IO_Error_Timestamp:
1 row in set, 1 warning (0.00 sec)

slave1 [localhost] {msandbox} ((none)) > SHOW REPLICA STATUS\G
Replica_IO_State: Waiting for source to send event
Replica_IO_Running: Yes
Last_IO_Errno: 0
Last_IO_Error:
Last_IO_Error_Timestamp:
1 row in set (0.00 sec)

Viewing all articles
Browse latest Browse all 581

Trending Articles