Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
mysql-freeze
Search
ichirin2501
March 10, 2018
Programming
0
340
mysql-freeze
ichirin2501
March 10, 2018
Tweet
Share
More Decks by ichirin2501
See All by ichirin2501
MySQL運用とらぶるすとーり〜^2 / MySQL-Troubleshooting-Story
ichirin2501
7
12k
計算量と僕とWeb開発 / computational complexity and I and Web
ichirin2501
14
10k
Other Decks in Programming
See All in Programming
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
770
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
1k
CSC509 Lecture 14
javiergs
PRO
0
140
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
330
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
1
130
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
testcontainers のススメ
sgash708
1
120
暇に任せてProxmoxコンソール 作ってみました
karugamo
1
720
良いユニットテストを書こう
mototakatsu
5
2k
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
Featured
See All Featured
Making Projects Easy
brettharned
116
5.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Producing Creativity
orderedlist
PRO
341
39k
The Cult of Friendly URLs
andyhume
78
6.1k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Site-Speed That Sticks
csswizardry
2
190
GraphQLとの向き合い方2022年版
quramy
44
13k
Into the Great Unknown - MozCon
thekraken
33
1.5k
Side Projects
sachag
452
42k
Transcript
MySQL freeze ͷר גࣜձࣾͯͳ id: ichirin2501 2017-08-19 Kyoto.ͳΜ͔ #3
ࣗݾհ • ݩߊ ( @ichirin2501 ) • ͯͳͷWebΦϖϨʔγϣϯΤϯδχΞ ڵຯ
ࠓճͷ͓
MySQLͷfreeze!!
࣌ʹ֬ೝग़དྷͨൣғΛྻڍ • ٸʹࢮ͵ • ࢮʹํfreeze, MySQLͷϓϩηεੜ͖ͯΔ • mysqladmin pingͳͲͷԠग़དྷΔ •
Ұ෦σʔλϕʔεͷΫΤϦ͕ฦͬͯ͜ͳ͍ • TCPͷଓཱ֬ग़དྷΔ, TCP keepaliveಈ͍ͯΔ • ΤϥʔϩάʹԿใग़ྗ͞Ε͍ͯͳ͍
͏͚Δ
͏͚ͳ͍
MySQLͷόʔδϣϯͱ͔ • MySQL-5.5.46 • mysql-server-5.5_5.5.46-0+deb7u1_amd64.deb • mysql-server-5.5_5.5.46-0+deb8u1_amd64.deb • OS: Debian
7.10(wheezy) or 8.1(jessie) • Kernel: wheezy=3.10.23, jessie=3.16.0
ڧҾʹ࠶ݱͤ͞Δ
sysbench !! (ҙ:benchmarkπʔϧ)
ߴෛՙΛ͔͚ଓ͚ͨΒ࠶ݱ͠ ͨʂʂ
sysbenchʹΑΔࡶͳݕূ݁Ռ EFCJBO EFCJBO P P Y Y
Y P P P P P x͕freeze
ϚΠφʔόʔδϣϯΛ্͛Δ 5.5.46 -> 5.5.52
ຊ൪ͰFreeze͠ͳ͘ͳͬͨ
ԿΘ͔ΒΜ͕ฏ͕๚Εͨ
࣌ա͗...
։ൃऀɿʮscript࣮ߦͯͨ͠Βfreezeͨ͠ʯ ࢲɿʮ͋ʔ͋ʔɺͳʹฉ͑͜·ͤΜʯ
MySQL-5.6.27͕Freeze
࠶ݕূ1 • աڈͷ؆қͳݕূͰfreeze͠ͳ͔ͬͨ • ಉݕূΛ࠶ߦ͕ͬͨ࠶ݱग़དྷͳ͍ • : sysbenchετϨεςετͰͳ͍
࠶ݕূ2 • ࣮ࡍʹϑϦʔζͨ͠batchεΫϦϓτͰࢼ͢ • 1ճ25࣌ؒͷbatchεΫϦϓτ • ݕূճ͕ॏͶΒΕͳ͍͕ࢼͦ͏ʂ
1ճͰݟࣄʹfreeze ͬͨͶʂʂʂʂʂ
ௐࠪ • Ҏલௐࠪͨ͠ͱ͖ʹεϧʔ͍߲͕ͯͨ͠ؾ ʹͳͬͨ • mysql-5.5.49ͷBugs FixedͷҰ෦ • InnoDB: Running
REPLACE operations on multiple connections resulted in a hang. (Bug #22530768, Bug #79185)
bug report • ʮInnodb freeze running REPLACE statementsʯhttps://bugs.mysql.com/ bug.php?id=79185 •
ಈ࡞ڥͱݱ͕ࠅࣅ͍ͯͨ͠ɻ ͰɺREPLACEΫΤϦࠓճͷfreezeࣄ݅ʹ ͓͍ͯҰൃߦ͞Ε͍ͯͳ͍
ؾʹͳͬͯίʔυΛݟʹߦ͘ • https://github.com/mysql/mysql-server/ search?q=22530768&type=Commits&utf8= %E2%9C%93 • |'o') TASपΓͷमਖ਼͡ΌΜ....REPLACEΫΤϦ ʹݶΒͳ͍ͷͰ....ෆԺ
ϚΠφʔόʔδϣϯΛ্͛Δ • 5.6.27ʹઌ΄ͲͷBugfixؚ·Ε͍ͯͳ ͍ɻͱΓ͋͑ͣ5.6.37·Ͱ্͛ͯscriptΛ࣮ߦ • ಉ༷ͷscriptΛԿ͔࣮ߦ͕ͨ͠freezeͳ͠ ࠓฏʂʂʂ
Α͘Θ͔ΒΜ͕ղܾʂʂ
ฏ͕Ұ൪
·ͱΊ • ϛυϧΣΞͷݕূेʹߦ͍·͠ΐ͏ • ͪΌΜͱετϨεςετΛ࣮ࢪ͠·͠ΐ͏ • ؾʹͳͬͨBugमਖ਼ͷίϛοτΛݟʹߦ͜͏