SlideShare a Scribd company logo
hbaseconasia2017: Removable singularity: a story of HBase upgrade in Pinterest
Tian-Ying Chang
Storage & Caching, Engineering @ Pinterest
Removable Singularity
AStoryof HBaseUpgradeatPinterest
1
2
3
4
5
Agenda Usage of HBase in Pinterest
Upgrading Situation and Challenges
Migration Steps
Performance Tuning
Final Notes
HBase @ Pinterest
§Early applications: homefeed, search & discovery
§UserMetaStore: a generic store layer for all applications using user
KV data
§Zen: a graph service layer
• Many applications can be modeled as graph
• Usage of HBase flourished after Zen release
§Other misc. use cases, e.g., analytics, OpenTSDB
40+ HBase clusters on 0.94
Need Upgrading
§HBase 0.94 is not supported by community anymore
§Newer version has better reliability, availability and
performance
§Easier to contribute back to community
Singularity of HBase 0.96
§RPC protocol changes
§Data format changes
§HDFS folder structure changes
§API changes
§Generally considered “impossible” to live upgrade without
downtime
http://blog.cloudera.com/blog/2012/06/the-singularity-hbase-compatibility-and-extensibility/
The Dilemma
§Singularity: cannot live upgrade from HBase 0.94 to later
version
• Need downtime
§Pinterest hosts critical online real time services on HBase
• Cannot afford downtime
§Stuck?
Fast Forward
§Successfully upgraded production clusters last
year
• Chose one of the most loaded clusters as pilot
• No application redeploy needed on the day of switching
to 1.2 cluster
• Live switch with no interrupt to Pinterest site
§Big performance improvement
P99LatencyofDifferentAPIs
Pointof LiveSwitch
How did we do it?
ZK
Client
read/write
HBase 0.94
ZK
Client
read/write
HBase 0.94 HBase 0.94
native
replication
ZK
Client
read/write
HBase 0.94 HBase 0.94
native
replication
ZK
Client
read/write
HBase 0.94
ZK
Client
read/write
HBase 0.94 HBase 0.94
1. Build empty cluster
ZK
Client
read/write
HBase 0.94 HBase 0.94
native
replication
1. Build empty cluster
2. Setup replication
ZK
Client
read/write
HBase 0.94 HBase 0.94
native
replication
1. Build empty cluster
2. Setup replication
3. Export snapshot
ZK
Client
read/write
HBase 0.94 HBase 0.94
native
replication
1. Build empty cluster
2. Setup replication
3. Export snapshot
4. Recover table from snapshot
ZK
Client
read/write
HBase 0.94 HBase 0.94
native
replication
1. Build empty cluster
2. Setup replication
3. Export snapshot
4. Recover table from snapshot
5. Replication drain
ZK
Client
read/write
HBase 0.94 HBase 0.94
native
replication
ZK
Client
read/write
HBase 0.94 HBase 1.2replication
ZK
Client
read/write
HBase 0.94 HBase 1.2replication
ZK
Client
read/write
HBase 0.94HBase 0.94
ZK
Client
read/write
HBase 0.94 HBase 1.2
1. Build empty cluster
HBase 0.94
ZK
Client
read/write
HBase 0.94 HBase 1.2
non-native
replication
1. Build empty cluster
2. Setup replication
HBase 0.94
ZK
Client
read/write
HBase 0.94 HBase 1.2
non-native
replication
1. Build empty cluster
2. Setup replication
3. Export snapshot
HBase 0.94
ZK
Client
read/write
HBase 0.94 HBase 1.2
non-native
replication
1. Build empty cluster
2. Setup replication
3. Export snapshot
4. Recover 1.2 table from 0.94 snapshot
HBase 0.94
ZK
Client
read/write
HBase 0.94 HBase 1.2
non-native
replication
1. Build empty cluster
2. Setup replication
3. Export snapshot
4. Recover table from snapshot
5. Replication drain
HBase 0.94
ZK
Client
read/write
HBase 0.94 HBase 1.2
non-native
replicationHBase 0.94
Major Problems to Solve
Client able to talk to both 0.94 and 1.2 automatically
Data can be replicated between HBase 0.94 and 1.2 bi-
directional
AsyncHBase Client
§Chose AsyncHBase due to better throughput and latency
• Stock AsyncHBase 1.7 can talk to both 0.94 and later version by
detecting the HBase version and use different protocol
§But cannot directly use stock AsyncHBase 1.7
• We made many private improvements internally
• Need to make those private features work with 1.2 cluster
AsyncHBase Client Improvements
§ BatchGet (open sourced in tsdb 2.4)
§ SmallScan
§ Ping feature to handle AWS network issue
§ Pluggable metric framework
§ Metrics broken down by RPC/region/RS
• Useful for debugging issues with better slice and dice
§ Rate limiting feature
• Automatically throttle/blacklist requests based on, e.g., latency
• Easier and better place to do throttling than at HBase RS side
§ In progress to open source
Live Data Migration
§Export snapshots from 0.94, recover tables in 1.2
• Relatively easy since we were already doing it between 0.94 and 0.94
• Modifying our existing DR/backup tool to work between 0.94 and
1.2
§Bidirectional live replication between 0.94 and 1.2
• Breaking changes in RPC protocol means native replication does not
work
• Using thrift replication to overcome the issue
Thrift Replication
§Patch from Flurry HBASE-12814
§Fixed a bug in the 0.98/1.2 version
• Threading bug exposed during prod data testing with high write QPS
• Fixed by implementing thrift client connection pool for each replication sink
• Fix also made the replication more performant
§Bidirectional is needed for potential rollback
§Verification!!
• Chckr: tool for checking data replication consistency between 0.94 and 1.2 cluster
• Used a configurable timestamp parameter to eliminate false positive caused by
replication delay
Upgrade Steps (Recap)
§Build new 1.2 empty cluster
§Set up master/master thrift replication between 0.94 and 1.2
§Export snapshot from 0.94 into 1.2 cluster
§Recover table in 1.2 cluster
§Replication draining
§Monitor health metrics
§Switch client to use 1.2 cluster
Performance
§Use production dark read/write traffic to verify performance
§Measured round trip latency from AsyncHBase layer
• Cannot do server latency compare since 1.2 has p999 server side
latency, while 0.94 does not
• Use metric breakdown by RPS/region/RS with Ostrich
implementation to compare performance
Get
BatchGet
Put
CompAndSet
Delete
Read Performance
§Default config has worse p99 latency **
• Bucket cache hurts p99 latency due to bad GC
§Short circuit read helps latency
§Use CMS instead of G1GC
§Native checksum helps latency
**The read path off-heap feature from 2.0 should help a lot. HBASE-17138
Write Performance
§Use write heavy load user case to expose perf issues
§Metrics shows much higher wal sync ops than 0.94
§Disruptor based wal sync implementation caused too much wal
sync operation
§hbase.regionserver.hlog.syncer.count default is 5, changed to 1
Thanks!
Community helps from Michael Stack and Rahul Gidwani
© Copyright, All Rights Reserved, Pinterest Inc. 2017
We are hiring!

More Related Content

PDF
hbaseconasia2017: Large scale data near-line loading method and architecture
HBaseCon
 
PDF
hbaseconasia2017: HBase Disaster Recovery Solution at Huawei
HBaseCon
 
PDF
hbaseconasia2017: HBase在Hulu的使用和实践
HBaseCon
 
PDF
hbaseconasia2017: hbase-2.0.0
HBaseCon
 
PDF
hbaseconasia2017: Apache HBase at Netease
HBaseCon
 
PDF
HBaseCon2017 Removable singularity: a story of HBase upgrade in Pinterest
HBaseCon
 
PDF
Meet HBase 1.0
enissoz
 
PPTX
HBase: Where Online Meets Low Latency
HBaseCon
 
hbaseconasia2017: Large scale data near-line loading method and architecture
HBaseCon
 
hbaseconasia2017: HBase Disaster Recovery Solution at Huawei
HBaseCon
 
hbaseconasia2017: HBase在Hulu的使用和实践
HBaseCon
 
hbaseconasia2017: hbase-2.0.0
HBaseCon
 
hbaseconasia2017: Apache HBase at Netease
HBaseCon
 
HBaseCon2017 Removable singularity: a story of HBase upgrade in Pinterest
HBaseCon
 
Meet HBase 1.0
enissoz
 
HBase: Where Online Meets Low Latency
HBaseCon
 

What's hot (20)

PPTX
HBaseCon 2015: HBase 2.0 and Beyond Panel
HBaseCon
 
PDF
Breaking the Sound Barrier with Persistent Memory
HBaseCon
 
PDF
HBaseCon 2015: HBase at Scale in an Online and High-Demand Environment
HBaseCon
 
PPTX
Real-time HBase: Lessons from the Cloud
HBaseCon
 
PPTX
Apache HBase, Accelerated: In-Memory Flush and Compaction
HBaseCon
 
PPT
HBase at Xiaomi
HBaseCon
 
PPTX
HBaseCon 2012 | Base Metrics: What They Mean to You - Cloudera
Cloudera, Inc.
 
PPTX
Meet hbase 2.0
enissoz
 
PDF
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Masao Fujii
 
PDF
Accordion HBaseCon 2017
Edward Bortnikov
 
PPTX
HBaseCon 2012 | Solbase - Kyungseog Oh, Photobucket
Cloudera, Inc.
 
PDF
HBaseCon2017 Improving HBase availability in a multi tenant environment
HBaseCon
 
PDF
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree
Ashnikbiz
 
PDF
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon
 
PDF
PostreSQL HA and DR Setup & Use Cases
Ashnikbiz
 
PDF
HBaseCon2017 gohbase: Pure Go HBase Client
HBaseCon
 
PDF
Usage case of HBase for real-time application
Edward Yoon
 
PDF
25 snowflake
剑飞 陈
 
PDF
Demystifying postgres logical replication percona live sc
Emanuel Calvo
 
PDF
Apache HBase Low Latency
Nick Dimiduk
 
HBaseCon 2015: HBase 2.0 and Beyond Panel
HBaseCon
 
Breaking the Sound Barrier with Persistent Memory
HBaseCon
 
HBaseCon 2015: HBase at Scale in an Online and High-Demand Environment
HBaseCon
 
Real-time HBase: Lessons from the Cloud
HBaseCon
 
Apache HBase, Accelerated: In-Memory Flush and Compaction
HBaseCon
 
HBase at Xiaomi
HBaseCon
 
HBaseCon 2012 | Base Metrics: What They Mean to You - Cloudera
Cloudera, Inc.
 
Meet hbase 2.0
enissoz
 
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Masao Fujii
 
Accordion HBaseCon 2017
Edward Bortnikov
 
HBaseCon 2012 | Solbase - Kyungseog Oh, Photobucket
Cloudera, Inc.
 
HBaseCon2017 Improving HBase availability in a multi tenant environment
HBaseCon
 
Countdown to PostgreSQL v9.5 - Foriegn Tables can be part of Inheritance Tree
Ashnikbiz
 
HBaseCon 2015: Taming GC Pauses for Large Java Heap in HBase
HBaseCon
 
PostreSQL HA and DR Setup & Use Cases
Ashnikbiz
 
HBaseCon2017 gohbase: Pure Go HBase Client
HBaseCon
 
Usage case of HBase for real-time application
Edward Yoon
 
25 snowflake
剑飞 陈
 
Demystifying postgres logical replication percona live sc
Emanuel Calvo
 
Apache HBase Low Latency
Nick Dimiduk
 
Ad

Similar to hbaseconasia2017: Removable singularity: a story of HBase upgrade in Pinterest (20)

PDF
HBaseConAsia2018 Track3-4: HBase and OpenTSDB practice at Huawei
Michael Stack
 
PDF
Apache HBaseの現在 - 火山と呼ばれたHBaseは今どうなっているのか
Toshihiro Suzuki
 
PPTX
HBaseCon 2015: HBase Operations in a Flurry
HBaseCon
 
PDF
HBaseCon 2015: Meet HBase 1.0
HBaseCon
 
PPTX
HBase New Features
rxu
 
PPTX
Meet Apache HBase - 2.0
DataWorks Summit
 
PPTX
Meet HBase 2.0
enissoz
 
PDF
Apache HBase: Where We've Been and What's Upcoming
huguk
 
PPTX
HBase Low Latency, StrataNYC 2014
Nick Dimiduk
 
PPTX
H base introduction & development
Shashwat Shriparv
 
PDF
London + Dublin Cassandra 2.0
jbellis
 
PPTX
Hbase 89 fb online configuration
NCKU
 
PDF
impalapresentation-130130105033-phpapp02 (1)_221220_235919.pdf
ssusere05ec21
 
PDF
Openstack HA
Yong Luo
 
PPTX
HBaseConAsia2018 Track2-4: HTAP DB-System: AsparaDB HBase, Phoenix, and Spark
Michael Stack
 
PPT
8b. Column Oriented Databases Lab
Fabio Fumarola
 
PDF
HBase tales from the trenches
wchevreuil
 
PPTX
Managing Hadoop, HBase and Storm Clusters at Yahoo Scale
DataWorks Summit/Hadoop Summit
 
PDF
03 h base-2-installation_andshell
dntth0601
 
PPTX
Impala presentation
trihug
 
HBaseConAsia2018 Track3-4: HBase and OpenTSDB practice at Huawei
Michael Stack
 
Apache HBaseの現在 - 火山と呼ばれたHBaseは今どうなっているのか
Toshihiro Suzuki
 
HBaseCon 2015: HBase Operations in a Flurry
HBaseCon
 
HBaseCon 2015: Meet HBase 1.0
HBaseCon
 
HBase New Features
rxu
 
Meet Apache HBase - 2.0
DataWorks Summit
 
Meet HBase 2.0
enissoz
 
Apache HBase: Where We've Been and What's Upcoming
huguk
 
HBase Low Latency, StrataNYC 2014
Nick Dimiduk
 
H base introduction & development
Shashwat Shriparv
 
London + Dublin Cassandra 2.0
jbellis
 
Hbase 89 fb online configuration
NCKU
 
impalapresentation-130130105033-phpapp02 (1)_221220_235919.pdf
ssusere05ec21
 
Openstack HA
Yong Luo
 
HBaseConAsia2018 Track2-4: HTAP DB-System: AsparaDB HBase, Phoenix, and Spark
Michael Stack
 
8b. Column Oriented Databases Lab
Fabio Fumarola
 
HBase tales from the trenches
wchevreuil
 
Managing Hadoop, HBase and Storm Clusters at Yahoo Scale
DataWorks Summit/Hadoop Summit
 
03 h base-2-installation_andshell
dntth0601
 
Impala presentation
trihug
 
Ad

More from HBaseCon (20)

PDF
hbaseconasia2017: Building online HBase cluster of Zhihu based on Kubernetes
HBaseCon
 
PDF
hbaseconasia2017: HBase on Beam
HBaseCon
 
PDF
hbaseconasia2017: HareQL:快速HBase查詢工具的發展過程
HBaseCon
 
PDF
hbaseconasia2017: 基于HBase的企业级大数据平台
HBaseCon
 
PDF
hbaseconasia2017: HBase at JD.com
HBaseCon
 
PDF
hbaseconasia2017: Ecosystems with HBase and CloudTable service at Huawei
HBaseCon
 
PDF
hbaseconasia2017: HBase Practice At XiaoMi
HBaseCon
 
PDF
HBaseCon2017 Democratizing HBase
HBaseCon
 
PDF
HBaseCon2017 Quanta: Quora's hierarchical counting system on HBase
HBaseCon
 
PDF
HBaseCon2017 Transactions in HBase
HBaseCon
 
PDF
HBaseCon2017 Highly-Available HBase
HBaseCon
 
PDF
HBaseCon2017 Apache HBase at Didi
HBaseCon
 
PDF
HBaseCon2017 Spark HBase Connector: Feature Rich and Efficient Access to HBas...
HBaseCon
 
PDF
HBaseCon2017 Efficient and portable data processing with Apache Beam and HBase
HBaseCon
 
PDF
HBaseCon2017 HBase at Xiaomi
HBaseCon
 
PDF
HBaseCon2017 HBase/Phoenix @ Scale @ Salesforce
HBaseCon
 
PDF
HBaseCon2017 Community-Driven Graphs with JanusGraph
HBaseCon
 
PDF
HBaseCon2017 Warp 10, a novel approach to managing and analyzing time series ...
HBaseCon
 
PDF
HBaseCon2017 Analyzing cryptocurrencies in real time with hBase, Kafka and St...
HBaseCon
 
PDF
HBaseCon2017 Achieving HBase Multi-Tenancy with RegionServer Groups and Favor...
HBaseCon
 
hbaseconasia2017: Building online HBase cluster of Zhihu based on Kubernetes
HBaseCon
 
hbaseconasia2017: HBase on Beam
HBaseCon
 
hbaseconasia2017: HareQL:快速HBase查詢工具的發展過程
HBaseCon
 
hbaseconasia2017: 基于HBase的企业级大数据平台
HBaseCon
 
hbaseconasia2017: HBase at JD.com
HBaseCon
 
hbaseconasia2017: Ecosystems with HBase and CloudTable service at Huawei
HBaseCon
 
hbaseconasia2017: HBase Practice At XiaoMi
HBaseCon
 
HBaseCon2017 Democratizing HBase
HBaseCon
 
HBaseCon2017 Quanta: Quora's hierarchical counting system on HBase
HBaseCon
 
HBaseCon2017 Transactions in HBase
HBaseCon
 
HBaseCon2017 Highly-Available HBase
HBaseCon
 
HBaseCon2017 Apache HBase at Didi
HBaseCon
 
HBaseCon2017 Spark HBase Connector: Feature Rich and Efficient Access to HBas...
HBaseCon
 
HBaseCon2017 Efficient and portable data processing with Apache Beam and HBase
HBaseCon
 
HBaseCon2017 HBase at Xiaomi
HBaseCon
 
HBaseCon2017 HBase/Phoenix @ Scale @ Salesforce
HBaseCon
 
HBaseCon2017 Community-Driven Graphs with JanusGraph
HBaseCon
 
HBaseCon2017 Warp 10, a novel approach to managing and analyzing time series ...
HBaseCon
 
HBaseCon2017 Analyzing cryptocurrencies in real time with hBase, Kafka and St...
HBaseCon
 
HBaseCon2017 Achieving HBase Multi-Tenancy with RegionServer Groups and Favor...
HBaseCon
 

Recently uploaded (20)

PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Doc9.....................................
SofiaCollazos
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 

hbaseconasia2017: Removable singularity: a story of HBase upgrade in Pinterest

  • 2. Tian-Ying Chang Storage & Caching, Engineering @ Pinterest Removable Singularity AStoryof HBaseUpgradeatPinterest
  • 3. 1 2 3 4 5 Agenda Usage of HBase in Pinterest Upgrading Situation and Challenges Migration Steps Performance Tuning Final Notes
  • 4. HBase @ Pinterest §Early applications: homefeed, search & discovery §UserMetaStore: a generic store layer for all applications using user KV data §Zen: a graph service layer • Many applications can be modeled as graph • Usage of HBase flourished after Zen release §Other misc. use cases, e.g., analytics, OpenTSDB
  • 6. Need Upgrading §HBase 0.94 is not supported by community anymore §Newer version has better reliability, availability and performance §Easier to contribute back to community
  • 7. Singularity of HBase 0.96 §RPC protocol changes §Data format changes §HDFS folder structure changes §API changes §Generally considered “impossible” to live upgrade without downtime http://blog.cloudera.com/blog/2012/06/the-singularity-hbase-compatibility-and-extensibility/
  • 8. The Dilemma §Singularity: cannot live upgrade from HBase 0.94 to later version • Need downtime §Pinterest hosts critical online real time services on HBase • Cannot afford downtime §Stuck?
  • 9. Fast Forward §Successfully upgraded production clusters last year • Chose one of the most loaded clusters as pilot • No application redeploy needed on the day of switching to 1.2 cluster • Live switch with no interrupt to Pinterest site §Big performance improvement
  • 11. How did we do it?
  • 13. ZK Client read/write HBase 0.94 HBase 0.94 native replication
  • 14. ZK Client read/write HBase 0.94 HBase 0.94 native replication
  • 16. ZK Client read/write HBase 0.94 HBase 0.94 1. Build empty cluster
  • 17. ZK Client read/write HBase 0.94 HBase 0.94 native replication 1. Build empty cluster 2. Setup replication
  • 18. ZK Client read/write HBase 0.94 HBase 0.94 native replication 1. Build empty cluster 2. Setup replication 3. Export snapshot
  • 19. ZK Client read/write HBase 0.94 HBase 0.94 native replication 1. Build empty cluster 2. Setup replication 3. Export snapshot 4. Recover table from snapshot
  • 20. ZK Client read/write HBase 0.94 HBase 0.94 native replication 1. Build empty cluster 2. Setup replication 3. Export snapshot 4. Recover table from snapshot 5. Replication drain
  • 21. ZK Client read/write HBase 0.94 HBase 0.94 native replication
  • 25. ZK Client read/write HBase 0.94 HBase 1.2 1. Build empty cluster HBase 0.94
  • 26. ZK Client read/write HBase 0.94 HBase 1.2 non-native replication 1. Build empty cluster 2. Setup replication HBase 0.94
  • 27. ZK Client read/write HBase 0.94 HBase 1.2 non-native replication 1. Build empty cluster 2. Setup replication 3. Export snapshot HBase 0.94
  • 28. ZK Client read/write HBase 0.94 HBase 1.2 non-native replication 1. Build empty cluster 2. Setup replication 3. Export snapshot 4. Recover 1.2 table from 0.94 snapshot HBase 0.94
  • 29. ZK Client read/write HBase 0.94 HBase 1.2 non-native replication 1. Build empty cluster 2. Setup replication 3. Export snapshot 4. Recover table from snapshot 5. Replication drain HBase 0.94
  • 30. ZK Client read/write HBase 0.94 HBase 1.2 non-native replicationHBase 0.94
  • 31. Major Problems to Solve Client able to talk to both 0.94 and 1.2 automatically Data can be replicated between HBase 0.94 and 1.2 bi- directional
  • 32. AsyncHBase Client §Chose AsyncHBase due to better throughput and latency • Stock AsyncHBase 1.7 can talk to both 0.94 and later version by detecting the HBase version and use different protocol §But cannot directly use stock AsyncHBase 1.7 • We made many private improvements internally • Need to make those private features work with 1.2 cluster
  • 33. AsyncHBase Client Improvements § BatchGet (open sourced in tsdb 2.4) § SmallScan § Ping feature to handle AWS network issue § Pluggable metric framework § Metrics broken down by RPC/region/RS • Useful for debugging issues with better slice and dice § Rate limiting feature • Automatically throttle/blacklist requests based on, e.g., latency • Easier and better place to do throttling than at HBase RS side § In progress to open source
  • 34. Live Data Migration §Export snapshots from 0.94, recover tables in 1.2 • Relatively easy since we were already doing it between 0.94 and 0.94 • Modifying our existing DR/backup tool to work between 0.94 and 1.2 §Bidirectional live replication between 0.94 and 1.2 • Breaking changes in RPC protocol means native replication does not work • Using thrift replication to overcome the issue
  • 35. Thrift Replication §Patch from Flurry HBASE-12814 §Fixed a bug in the 0.98/1.2 version • Threading bug exposed during prod data testing with high write QPS • Fixed by implementing thrift client connection pool for each replication sink • Fix also made the replication more performant §Bidirectional is needed for potential rollback §Verification!! • Chckr: tool for checking data replication consistency between 0.94 and 1.2 cluster • Used a configurable timestamp parameter to eliminate false positive caused by replication delay
  • 36. Upgrade Steps (Recap) §Build new 1.2 empty cluster §Set up master/master thrift replication between 0.94 and 1.2 §Export snapshot from 0.94 into 1.2 cluster §Recover table in 1.2 cluster §Replication draining §Monitor health metrics §Switch client to use 1.2 cluster
  • 37. Performance §Use production dark read/write traffic to verify performance §Measured round trip latency from AsyncHBase layer • Cannot do server latency compare since 1.2 has p999 server side latency, while 0.94 does not • Use metric breakdown by RPS/region/RS with Ostrich implementation to compare performance
  • 39. Read Performance §Default config has worse p99 latency ** • Bucket cache hurts p99 latency due to bad GC §Short circuit read helps latency §Use CMS instead of G1GC §Native checksum helps latency **The read path off-heap feature from 2.0 should help a lot. HBASE-17138
  • 40. Write Performance §Use write heavy load user case to expose perf issues §Metrics shows much higher wal sync ops than 0.94 §Disruptor based wal sync implementation caused too much wal sync operation §hbase.regionserver.hlog.syncer.count default is 5, changed to 1
  • 41. Thanks! Community helps from Michael Stack and Rahul Gidwani
  • 42. © Copyright, All Rights Reserved, Pinterest Inc. 2017 We are hiring!