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
hbstyle-2014-12-11
Search
rrreeeyyy
December 11, 2014
Technology
8
2.9k
hbstyle-2014-12-11
MySQL 5.6.10 以下に存在する レプリケーションのバグと原因特定について (Heartbeats 社内勉強会 2014/12/11)
rrreeeyyy
December 11, 2014
Tweet
Share
More Decks by rrreeeyyy
See All by rrreeeyyy
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
180
An Efficient Incident Response Training with AI / SRE NEXT 2024 Sponsor Session
rrreeeyyy
1
3.6k
カンファレンスから見る SRE トレンド 2024 / SRE Trends from Conferences in 2024 #SRE_Findy
rrreeeyyy
4
2.2k
信頼性の育て方 / mackerel-meetup-15
rrreeeyyy
10
2.4k
SRE の歩き方・進め方 / sre-walk-through-procedure
rrreeeyyy
0
8.6k
「信頼性」を保ちつつ大規模サービスをリニューアルする / cookpad-tech-kitchen-service-embedded-sres
rrreeeyyy
11
12k
Cookpad and Prometheus
rrreeeyyy
6
20k
SRE-Lounge-8-Cookpad-Microservice-Architecture-Overview
rrreeeyyy
5
5.3k
A survey of anomaly detection methodologies for web system
rrreeeyyy
5
1.2k
Other Decks in Technology
See All in Technology
C++26 エラー性動作
faithandbrave
2
760
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
3
310
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
220
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
190
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
160
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
3
2.4k
ハイテク休憩
sat
PRO
2
160
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
170
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
270
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
The Cult of Friendly URLs
andyhume
78
6.1k
A Tale of Four Properties
chriscoyier
157
23k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Automating Front-end Workflow
addyosmani
1366
200k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Gamification - CAS2011
davidbonilla
80
5.1k
Transcript
MySQL ϨϓϦέʔγϣϯͷόάͱ ݪҼಛఆʹ͍ͭͯ YOSHIKAWA Ryota hbstyle-2014-12-11 1
ࣄ • MySQL (5.5.32) ʹͯɺϨϓϦέʔγϣϯͷෆ۩߹͕ൃੜ • DDL શͯө͞ΕΔ • DML
ಛఆͷςʔϒϧʹͯө͞Εͳ͍ • Slave_(IO|SQL)_Running ڞʹ Yes • Τϥʔແ͠ • MySQL 5.6.10 Ҏલશ͕ͯ͜ͷόάͷର YOSHIKAWA Ryota hbstyle-2014-12-11 2
ݪҼ • MasterDB ͷ table_id ͕ UINT_MAX Λ͑ͨ߹ʹൃੜ • SlaveDB
ͷ table_id ͕Φʔόʔϑϩʔ • MasterDB ͕͍࣋ͬͯΔ table_id ͱ, ϨϓϦέʔγϣϯͰୡ͞ΕΔ table_id ʹෆ߹͕ൃੜ • binlog ͕ Row|Mixed ͷϨϓϦέʔγϣϯͰӨڹ • ৄ͘͠ http://bugs.mysql.com/bug.php?id=67352 YOSHIKAWA Ryota hbstyle-2014-12-11 3
ݪҼ (ଓ͖) • Master ͕ཧ͢Δ table_id (table_map_id) ulong •
64bit Linux ڥͰ 18446744073709551615 ͕࠷େ • Slave ͕ཧ͢Δ table_id uint • 64bit Linux ڥͰ 4294967295 ͕࠷େ • CREATE/DROP/TRUNCATE Ͱ table_id ͕૿Ճ͍ͯ͘͠ • ෆ߹͕ى͖Δͱ Slave σʔλΛߋ৽Ͱ͖ͳ͘ͳΔ YOSHIKAWA Ryota hbstyle-2014-12-11 4
• σόοάϩά # Master Ͱcheck_repl ςʔϒϧͷॻ͖ࠐΈΛͨ࣌͠ͷ Slave ͷσόοάϩά table_mapping::set_table(ulong,TABLE*): enter:
table_id: 20497567 table: 0x3d361f0 (check_repl) table_mapping::set_table(ulong,TABLE*): info: tid 20497567 -> table 0x3d361f0 (check_repl) table_mapping::get_table(ulong): enter: table_id: 4315464863 table_mapping::get_table(ulong): info: tid 4315464863 is not mapped! # ... 20497567 = 4315464863 - (4294967295 + 1) # ... (4294967295 ... UINT_MAX) • ιʔείʔυ * table_map_id > # grep -n "ulong table_map_id" sql/table.h > 645: ulong table_map_id; /* for row-based replication */ * table_id > # grep -n "uint table_id" sql/table.h > 1457: uint table_id; /* table id (from binlog) for opened table */ YOSHIKAWA Ryota hbstyle-2014-12-11 5
Ͳ͏ͬͯಛఆ͔ͨ͠ YOSHIKAWA Ryota hbstyle-2014-12-11 6
Day1 YOSHIKAWA Ryota hbstyle-2014-12-11 7
ਪଌʹΑΔԾઆݕূͷ܁Γฦ͠ • ਓ͕ؒ૾Ͱ͖Δൣғͷόάͩͱ͜ͷํ๏͕ߴ(ܦݧతʹ) • ಉ༷ͷݱ(slave ߋ৽ෆՄ)Λ google Ͱͻͨ͢Βݕࡧɾݕূ • ਓؒͷ૾Ͱ͖ͳ͍ൣғͷόάͩͱϋϚΔ
• લྫͷݟ͕ݕࡧͮ͠Β͍/ແ͍߹ಛʹ • ܦݧΛੵΉࣄͰൣғΛ͛Δ͜ͱՄೳͳؾ͢Δ YOSHIKAWA Ryota hbstyle-2014-12-11 8
Day2 YOSHIKAWA Ryota hbstyle-2014-12-11 9
ࣄͷ࠶ݱɾΓ͚ • ࣗͷݕࡧɾਪଌग़དྷΔϨϕϧΛ͍͑ͯΔࣄΛೝࣝ • ຊ൪ػͷ binlog ΛோΊͯոͦ͠͏ͳૢ࡞Λચ͍ग़͢ • Slave ͷσʔλΛݟͯԿ࣌ࠒʹෆ߹͕ى͖͔ͨ֬ೝ
• ෆ۩߹͕ى͖ͯΔ DB ͰࣄͷΓ͚ • σʔλϑΝΠϧͷ༰ྔຊʹ૿͍͑ͯͳ͍͔ • ϦϨʔϩάʹॻ͖ࠐΈ͕͋Δ͔... YOSHIKAWA Ryota hbstyle-2014-12-11 10
Day3 YOSHIKAWA Ryota hbstyle-2014-12-11 11
࠶ݱࡁΈڥͰͷσόοά • ো͕ى͖͍ͯͨ Master ʹผͷ Slave Λܨ͙ͱ࠶ݱग़དྷͨ • Slave ʹؔΘΒͣো͕ى͖Δ
=> Master ͓͔ͦ͠͏ • Slave ͷ MySQL Λ Debug ༗ޮͰϏϧυͯ͠ܨ͍ͰΈΔ cmake . -DWITH_DEBUG=1 -DMYSQL_MAINTAINER_MODE=0 • ਖ਼ৗͳ Master ʹܨ͍ͩ࣌ͷϩάͱҟৗͳϩάΛݟൺΔ • ϩάͱιʔείʔυΛൺֱͯ͠Ͳ͜ͰԿ͕ى͖ͯΔ͔Ѳ YOSHIKAWA Ryota hbstyle-2014-12-11 12
ʹཱͬͨπʔϧ • mysqlbinlog (binlog, relaylog ղੳ) • tcpdump & Percona
Toolkit (ύέοτɾσʔλෆ߹ௐࠪ) • icdiff (֤छϩάͷൺֱ) • gdb (MySQL ͷσόοά) • vim & ctags & Unite grep ... (ιʔείʔυϦʔσΟϯά) YOSHIKAWA Ryota hbstyle-2014-12-11 13
ʹཱͬͨݟ (1) • hbstyle Ͱͷݟ • @indigo13love ͞Μͷੲͷൃද • sql/slave.cc
ϨϓϦέʔγϣϯͷݟ • ܭࢉػՊֶͷݟ • MySQL Packet ͷϔομ͙Β͍ͳΒಡΊΔ • ֶ෦ͷ࣌ʹύέοτோΊͨݟ YOSHIKAWA Ryota hbstyle-2014-12-11 14
ʹཱͬͨݟ (2) • ιʔείʔυϦʔσΟϯάͷݟ • ֶ෦࢛Ͱ৭ΜͳιϑτΣΞͷιʔείʔυಡΜͩݟ • Apache, Nginx, Keepalived,
LVS ... • ϏϏΒͳ͍͜ͱ • ϩάͱಥ͖߹ΘͤͯಡΉ • πʔϧΛָͬͯͯ͠ಡΉ YOSHIKAWA Ryota hbstyle-2014-12-11 15
[demo] πʔϧͷ͍ํͱ͔ιʔεಡΈͱ͔ͪΐͬͱ͚ͩ YOSHIKAWA Ryota hbstyle-2014-12-11 16
ল YOSHIKAWA Ryota hbstyle-2014-12-11 17
Don't guess, measure! — Robert C. Pike YOSHIKAWA Ryota hbstyle-2014-12-11
18
ল • ਪଌ͢ΔͳɺܭଌͤΑ • ύϑΥʔϚϯε͚ͩͰͳ͘όάಉ͡ • (ఆͷ)؆୯ͳόάΛ૬खʹͯ͠ΔͱΕΔ͜ͱ͋Δ • ࣄɾݪҼΓ͚ɾιʔείʔυ͕શͯ •
ϩάΛݟΔɾιʔείʔυΛݟΔ YOSHIKAWA Ryota hbstyle-2014-12-11 19
• νϟοτͱ͔ͷݺͼ͔͚Ͱڠྗͯͩͬͨ͘͠͞օ͞Μ͋Γ͕ ͱ͏͍͟͝·ͨ͠ • ಛʹ @saito @takamoto @hosokoshi @matsuu ...
• ͬͱݕࡧྗ͕ߴ͚ΕҰൃͰͨͲΓண͍͔ͨ͠Εͳ͍ • http://bugs.mysql.com/bug.php?id=67352 • ͱ͍͑ MySQL ʹͪΐͬͱৄ͘͠ͳΕͯΑ͔ͬͨ YOSHIKAWA Ryota hbstyle-2014-12-11 20