Q4M でバイナリログが吐かれない?
仕様なのか設定ミスなのか、おそらく仕様だと思うんだけど。
普通のテーブルだと以下のようにバイナリログが吐かれる。
mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000021 | 1895 | | | +------------------+----------+--------------+------------------+ 1 row in set (0.00 sec) mysql> delete from test where a = 'hogehoge'; Query OK, 0 rows affected (0.02 sec) mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000021 | 1995 | | | +------------------+----------+--------------+------------------+ 1 row in set (0.00 sec)
しかし、queue エンジンのテーブルだと、以下のように、
バイナリログが吐かれない。
mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000021 | 1995 | | | +------------------+----------+--------------+------------------+ 1 row in set (0.00 sec) mysql> select queue_wait ('q4m_t'); +----------------------+ | queue_wait ('q4m_t') | +----------------------+ | 1 | +----------------------+ 1 row in set (0.00 sec) mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000021 | 1995 | | | +------------------+----------+--------------+------------------+ 1 row in set (0.00 sec) mysql> select count(*) from q4m_t; +----------+ | count(*) | +----------+ | 1 | +----------+ 1 row in set (0.00 sec) mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000021 | 1995 | | | +------------------+----------+--------------+------------------+ 1 row in set (0.00 sec) mysql> select queue_end ('q4m_t'); +---------------------+ | queue_end ('q4m_t') | +---------------------+ | 1 | +---------------------+ 1 row in set (0.08 sec) mysql> select count(*) from q4m_t; +----------+ | count(*) | +----------+ | 2 | +----------+ 1 row in set (0.00 sec) mysql> show master status; +------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000021 | 1995 | | | +------------------+----------+--------------+------------------+ 1 row in set (0.00 sec)
これって、アタリマエのことな気がする。queue_end() の中で、 delete 文を呼んだりしているのであればバイナリログが吐かれるだろうが、そういうわけではないだろうから。ちなみに、queue テーブルにデータを insert した場合はバイナリログは吐かれる。これ、バックアップとか、復旧とかしたい場合に困らないだろうか・・・。