逝くぞ最新版、罠の貯蔵は十分か
Welcome 8.0, do you have enough traps?
2018/05/23
yoku0825
MySQL Innovation Day Tokyo
このスライドに記載された見
解は個人の意見であり、所属
する組織または所属しない組
織またはNULLの意見を 一切
代表するわけがありません
Safe horbor statement
1/44
タイトルで煽っている
割にまだ罠にはやられ
ていません
I’m not caught in a trap
yet
2/44
\こんにちわ/
yoku0825@GMOメディア株式会社
オラクれない‐
ポスグれない‐
マイエスキューエる‐
生息域
Twitter: @yoku0825‐
Blog: 日々の覚書‐
MyNA ML: 日本MySQLユーザ会‐
MySQL Casual: Slack‐
3/44
約3年前
About 3 years ago.
4/44
default_password_lifetime
= 360 ( < 5.7.11 )
5/44
パスワード変更から 360
日 でアカウントがロック
される
MySQL account will lock after
360 days during last
password changed
6/44
アップグレード
から
After upgrade to
5.7,
7/44
360日後に
襲ってくる
After 360 days,
8/44
_人人人人人人_
> 突然の死 <
 ̄Y^Y^Y^Y^ ̄
We dies suddenly!
9/44
default_password_lifetime = 360 ( < 5.7.11 )
もう直ってる(?)から気にしなくても大丈夫ですよ
This had been changed to 0, don’t worry‐
MySQL Bugs: #77277: default_password_lifetime
should be set 0 as implicit default value
Thank you MySQL Server Team!‐
10/44
の人です
I’m who
talked that.
11/44
MySQL 8.0、GAリ
リースおめでとうござ
います!
Congratulations for
MySQL 8.0 GA Release!!
12/44
実はまだMySQL 8.0
そんなに触ってません
I didn’t play enough with
MySQL 8.0
13/44
“あんまり”
Not enough
14/44
ぶっちゃけ8.0ど
うよ?
Honestly, I think
8.0 is..
15/44
個人の見解です
This is my own
opinion
16/44
良くも悪くも色々なもの
の埋まり具合は5.7の比
じゃないと思う
Many features/bugs are lying
under the ground, more than
5.7.
17/44
たとえば
For example,
18/44
このバグ
This bug report.
How to repeat:
Start mysqld with –innodb-log-write-max-size=-1
MySQL Bugs: #90526: [MySQL 8.0 GA Release Build]
Assertion failure: write_max_size > 0
19/44
このバグ
This bug report.
This is one of new variables, which were not
supposed to be exposed. The fix is to hide them in
normal builds. During our tests we have not
encountered any situation in which it would make
sense to change their values.
MySQL Bugs: #90526: [MySQL 8.0 GA Release Build]
Assertion failure: write_max_size > 0
20/44
このバグ
This bug report.
GAリリースビルドなのに
Even in GA release build,‐
ドキュメントにないサーバー変数がフツーに見えて
There is new server-variable which is NOT described in
document,
‐
ちょっとそれに触るとあっさりクラッシュする
And set it then crash mysqld!!‐
そういえば今日もInnoDB関連の話題ないですね
No InnoDB session today..?‐
21/44
ここでMySQL 5.7の
時を振り返ってみま
しょう
By the way, looking back
5.7 GA release.
22/44
MySQL 5.7.9-GA
2015/10
innodb_default_row_format の導入
デフォルトは”Dynamic”‐
innodb_numa_interleave, JSON -> 演算子
23/44
_人人人人人_
> 新機能!! <
 ̄Y^Y^Y^Y^ ̄
New feature!!
24/44
MySQL 5.7.10-GA
2015/12
ここでようやくフィーチャーフリーズしたか。。
Does MySQL 5.7 freeze feature implementation?‐
25/44
MySQL 5.7.11-GA
2016/02
InnoDB Tablespace Encryption
26/44
_人人人人人_
> 新機能!! <
 ̄Y^Y^Y^Y^ ̄
New feature!!
27/44
MySQL 5.7.12-GA
2016/04
X Plugin
MySQLプロトコルの代わりにX Protocolをしゃべるポートを追加でき
るぷらぎん
‐
28/44
_人人人人人_
> 新機能!! <
 ̄Y^Y^Y^Y^ ̄
New feature!!
29/44
開き直った
And they said “More than a Maintenance Release”
Stay tuned
For more information on why MySQL 5.7.12
indeed marks a new milestone for MySQL.
MySQL 5.7.12 – Part 1: More than a Maintenance
Release
30/44
MySQL 5.7.13-GA
2016/06
JSON ->> 演算子
31/44
もう演算子の追加くらい
じゃ驚かなくなってきた
MySQL users didn’t surprise
even in new operator had
been added.
32/44
GA #とは なん
だったのか
What is GA means…
33/44
の、MySQL 5.7よりよっ
ぽど良くも悪くも “埋
まってそう”
More than 5.7, 8.0 are mined
much features/bugs into the
ground..
34/44
良くも悪くも
Terribly but
funny :D
35/44
そんな8.0お気に入りの新機能
New features I’m interesting in
SELECT .. FOR UPDATE SKIP LOCKED
performance_schema
variables_info, events_errors_summary_global_by_error‐
36/44
MySQLでキューっぽく
MySQL like a queue
auto_incrementのプライマリーキーがあるところに
SELECT .. ORDER BY <primary_key> ASC LIMIT 1 FOR
UPDATE SKIP LOCKED 、これだけでキューが表現できる
With auto_increment PRIMARY KEY, can implement a simple
queue system by only 1 SQL statement.
‐
今までQ4Mに頼っていたものがついに吊るしのMySQLだけ
で実現
Don’t need other middlewares(and Storage Engine) for small
environment
‐
クラッシュセーフだったりクライアントがやられた時は勝手
にロールバックされてロックがリリースされたり
Crash-safe guarantee by InnoDB, rollback and lock-release
automatically when client-program has gone away
‐
37/44
SQLエラーカウントの今までとこれから
Before and after, SQL error count
今までも events_statements_summary_by_digest で
SUM_ERRORS は確認できた
As of 5.7, we can see SUM_ERRORS in
events_statements_summary_by_digest
‐
これからは特定のエラー(特にシンタックスエラーを狙って
る)を events_errors_summary_by_account_by_error でアカ
ウントまであたりがつけられた上で監視できる
events_errors_summary_by_account_by_error makes us to be able
to see “How many errors occurred in a minuts” (Specially,
monitoring ER_SYNTAX_ERROR counts)
‐
38/44
エラーログ監視要らなくなるかも?
Can dump our error-log monitoring script?
events_errors_summary_global_by_error の LAST_SEEN が監
視間隔より現在時刻に近ければ通知とか?
ERROR_NUMBER, ERROR_NAME があるから WHERE .. NOT IN ..
でホワイトリストにしやすい
もうエラーログを頑張ってパースする必要はないの…か?
(謎)
We are tired for parsing error-log‐
39/44
パラメーターの変更検知
Detection for changing parameters
my.cnfへの適用忘れを防止するために今までは SHOW
GLOBAL VARIABLES を前回値と比較していた
Checking SHOW GLOBAL VARIABLES ‘s output for prevention
forgetting commit into my.cnf
‐
variables_info ができたので SET_TIME が監視間隔より現在
時刻に近ければトリガーしてやればいい
performance_schema.variables_info makes it easy, and‐
それ以前に SET PERSIST ができたから SET GLOBAL をオペ
レーション的に撲滅しちゃえばいいような気はする
We can choise the way to use SET PERSIST and prohibit to use
SET GLOBAL
‐
40/44
おそらく俺がこの話をする時
には既に何度も「GAとはなん
だったのか」があったはず
Maybe, there are too many
screams “What is GA means” until
my talk
41/44
大丈夫
Don’t worry
42/44
もう5.6くらいから
ずっとそうだったから
That is MySQL, from
about 5.6 era..
43/44
I’m staying
tuned!!
44/44

逝くぞ最新版、罠の貯蔵は十分か