SlideShare a Scribd company logo
1 of 29
Download to read offline
gen_paxos
             kuenishi
                     
2009/7/3 3rd Erlang‐meeting in
    Shirogane‐takanawa, Tokyo 
                          kuenishi@gmail.com  

         
                                                             
         Erlang         Python
         See id:kuenishi, g:erlang:id:kuenishi, @kuenishi 
                  http://github.com/kuenishi 
                  http://bitbucket.org/kuenishi 


    Recent Activities 
        Yet another TC‐Erlang binding 
                  http://bitbucket.org/kuenishi/yatce/ 
         Mercurial l10n 
                  1.3 has been released on 7/1! 
                  http://bitbucket.org/foozy/mercurial‐translation‐ja/ 




                                                                           2 
Outline
    Introduction 
    Why PAXOS? 
    What is PAXOS? 
    How can we implement PAXOS? 
         Why Erlang? 
    Where is PAXOS? 
    When? 
    Appendix 



    Notice: Basically English, Sometimes Japanese 



                                                      3 
Introduction – what is gen_paxos?
    GENeric PAXOS module written in Erlang 
       Reduction of the cost of re‐invention of wheels. 
       At first, I had aimed to make it sth like ‘behaviour’ 
       http://github.com/kuenishi/gen_paxos 



    Related works (I think not enough)  
       libpaxos 
       gen_leader 


         Why not enough? 




                                                                 4 
Why PAXOS?
     Split Brain 
            Typically, broken switches / wires 
            Both master and slave updates independently




                
                                                         




     ID
       name
   addr
                                ID
   name
   addr
     0
        Hage
         
                              0
    Hage
            
     1
        hoge
         
                              1
    hoge
            
     …
         …
      …
                                  …
     …
         …


                     Replication Master
     Replication Slave

                                 Data Inconsistency! Ouch!
                                                                                       5 
Why PAXOS? – cont’d
    Split Brain Problem 
         Separate actors can’t coordinate 
             Lacking coordination ‐> Multi‐master 
             Multi‐master ‐> Data Inconsistency 
             Inconsistency ‐> Tragedy 
         Typically, BigTable solely depends upon Chubby[2] 
               BigTable’s Master Election, so on. 


    Byzantine Generals Problem 
       A faulty actor who lies destroys consistency 
       I don’t know current implementation of gen_paxos solves 
        this problem – not in scope 
       See Byzantine PAXOS in Wikpedia[6]




                                                                   6 
What is PAXOS?
    Distributed Consensus/Coordination Algorithm 
       Masterless (no SPOF) 
       Robust to split brain environment such as network 
        separation 
       Proved to converge within infinite time period[9] 
       Works iff majority of fixed group of actors is alive 
        and communicable 




                                                                7 
What is PAXOS? – Example
  Two phase election – phase 1 
    Larger n is prior 

                              21:32
   21:36
                                              
            

         n=3


   21:35         n=2
                JK
                   n=1

 21:36                      21:38
                orz                     orz
                                                  8 
What is PAXOS? – Example
  Two phase election – phase 2  
     confirmation 
                            n=4
 21:43
                                         21:43
                                         …
21:41                                                      
                proposer
        
                                                   21:42
                                                       


            21:44
                                           21:43

                                                               9 
What is PAXOS? – data model in gen_paxos
    Actors 
       n processors with processor ID 

    Data 
       Instance ID (Subject) 
       Proposal ID (N) 
       Proposal itself (Value) 

  N should be unique 
                                    ID
    1
   2
    3
    4
    5
  At first, V differs 
                                   n(1)
   1
   2
    3
    4
    5
       later V converges
                                   n(2)
   6
   7
    8
    9
    10
                                   n(3)
 11
    12
   13
   14
   15
                                   n(4)
 16
    17
   18
   19
   20
                                   n(…)
   …
   …
    ..
   …
    ..
                                                                   10 
What is PAXOS? – details in gen_paxos
    Basic sequence of Each actor 

    Prepare Phase 
       If Prepare comes, agree or disagree  be Acceptor  
       If Prepare doesn’t come, send Prepare  be Proposer  
       If majority of group agrees Prepare, send Propose 
       If timeout, increase n and restart Prepare phase 

    Propose Phase 
       Acceptor – agree to Propose (ignoring lower n) 
       Proposer – decided if majority agrees 
       If timeout, increase n and restart Prepare phase 

    Commit Phase 
         Send the committed Value again to notify


                                                               11 
What is PAXOS? – details in gen_paxos
    Basic sequence of Each actor 

    Prepare Phase 
       Prepare                                 Acceptor  
       Prepare              Prepare           Proposer  
                 Prepare                  Propose 
                      n                
    Propose Phase 
       Acceptor ‐ Propose                  n                 
       Proposer ‐                            
                     n           Prepare Phase          
    Commit Phase 
                             


                                                                 12 
What is PAXOS? – details in gen_paxos
    Basic sequence of Each actor 

    Prepare Phase 
       Prepare                                 Acceptor  
       Prepare              Prepare           Proposer  
                 Prepare                  Propose 
                      n                
    Propose Phase 
       Acceptor ‐ Propose                    
       Proposer ‐                            
                     n           Prepare Phase          
    Commit Phase 
                             


                                                             13 
How can we implement PAXOS?




1. Make a State Diagram 
2. Write an FSM code 




                               14 
How can we implement PAXOS? (1/2)

1. Make a State Diagram 
                                                    [State]




                                           {Action, NextState}
                    [Event]

                               Define: 
                               • {State, Event} ‐> {NextState, Action}


                                                                    15 
How can we implement PAXOS? (2/2)

2.    Write an FSM code 

                         Define a set of 
                         Module:State/2 

                         Module:State(Event, Data)  
                            ‐> {next_state, 
                                NextState, NextData} 

                         (See paxos_fsm.erl for details)




                                                           16 
Process Architecture of a Node (gen_paxos.erl)
  A‐little‐bit load balancing 
  Not pursuing consensus performance 
  Thinkin’bout Chubby[5] (no dynamic node addition/removal) 



                       gen_fsm:start_link/4                  gen_fsm starts for
                       Creates gen_fsm after                    each subject
                       receiving message 

Sends message after 
balancing with                                             paxos_fsm(Key)
erlang:phash(Key,3)    coordinator0
                       coordinator1
                        coordinator2
                                                puts the result
                                                into process
                       gen_paxos.erl            dictionary after
                                                receiving message
      User
      process
                                                       Sends message 
                                                                     after getting 
     {Key, Value} 
                                                                     consensus 
                                                                                  17 
Messaging between nodes (paxos_fsm.erl)
    FSMs talk each other by sending events with globalname() 
         globalname() = {global, GlobalName}
         GlobalName is for first argument of gen_fsm:start_link/4 
    gen_fsm:send_event/2 sends Events to remote nodes 
         gen_fsm:send_event({global, GlobalName}, Event). – that’s all. 
    Anyway, no need to design application protocol, object 
     serialization, nor GoF ‘State, Observer’ pattern! That’s 
     WHY ERLANG!! 
                                               gen_fsm:send_event/2


             nodeA
                   nodeB
                           nodeC

          paxos_fsm
              paxos_fsm
                     paxos_fsm

          coordinators
           coordinators
                 coordinators

          User                   User                          User
          process
               process
                      process

                                                                                18 
Sample code – paxos_fsm.erl




  • acceptor      {prepare, {S,N,V,From}}   N
  • prepare_result
  • N V        acceptor




                                                19 
Where is PAXOS?




                   20 
Where is PAXOS?
  Paxon Isles in Aegean Sea[1] 
    ‘the part‐time parliament’[3]




                                      21 
Where is PAXOS? cont’d
    Looks so nice place to visit!




                                      22 
When?? ‐ References
    [1]PAXOS island 
          http://www.paxos‐greece.com/ 
    [2]Google, The Chubby Paper, 2006. 
    [3]Leslie Lamport, `The Part‐Time Parliament’, ACM Trans. Comput. Syst. 
     Volume 16 ,  Issue 2  (May 1998) , pp. 133 – 169. 
    [4]Leslie Lamport, `Paxos Made Simple’, SIGACT News, Vol. 32, No. 4. 
     (December 2001), pp. 51‐58. 
    [5]T Chandra et al., `Paxos made live: an engineering perspective’, PODC 
     '07, ACM Press, 2007, pp. 398‐407. 
    [6]Wikipedia, `Paxos_algorithm’,  
          http://en.wikipedia.org/wiki/Paxos_algorithm 
          1990                               
    [7]Lamport’s patent            M$…  
          http://www.j‐tokkyo.com/2005/G06F/JP2005‐196763.shtml 
    [8]David Mazieres, `Paxos Made Practical’, tech report, 2007. 
          http://net.pku.edu.cn/~course/cs501/2008/reading.html 
    [9]Dwork, Cynthia et al., `Consensus in the presence of partial 
     synchrony’, J. ACM 35‐2, pp. 288—323, 1988.  
    Other implementations 
          single‐phase majority‐voting is used in distributed memory, distributed CPU; 
           rather hardware. 
          libpaxos 


                                                                                           23 
  Any Questions?




              http://creativecommons.org/licenses/by‐sa/2.1/jp/

                                                               24 
appendix
    Known Bugs
           FAQ
             
 State Diagram
Appendix – Known Bug(s)
                            
                                    
                            


                                            
                    

                                 

                                         

                         





 
            


                                                 26 
Appendix – FAQ
                                       

                            

                                    
      
                                            


 
          

                                
                                                    
                                                        
      
                                            


 
                           
                 ?DEFAULT_TIMEOUT
                                            #state
              
                                                             27 
Appendix – State Diagram
                                      
                       


                                  
                                       




              
           
                   
                       
           




                      




                      




                      



                              
                   


                  
                       
               
                   
       
          


                                                                                          


                                                                  


                      
                       
                       
           




                                                      




                      
                       




                                                                                              28 
  Thanks! 




              http://creativecommons.org/licenses/by‐sa/2.1/jp/

                                                               29 

More Related Content

Viewers also liked

Couchbase introduction-20150611
Couchbase introduction-20150611Couchbase introduction-20150611
Couchbase introduction-20150611Couchbase Japan KK
 
Mongodb x business
Mongodb x businessMongodb x business
Mongodb x businessemin_press
 
[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...
[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...
[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...Insight Technology, Inc.
 
Db tech showcase2015
Db tech showcase2015Db tech showcase2015
Db tech showcase2015emin_press
 
Db tech show - hivemall
Db tech show - hivemallDb tech show - hivemall
Db tech show - hivemallMakoto Yui
 
[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...
[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...
[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...Insight Technology, Inc.
 
[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...
[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...
[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...Masahiro Tomisugi
 
[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...
[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...
[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...Insight Technology, Inc.
 
[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...
[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...
[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...Insight Technology, Inc.
 
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...Funada Yasunobu
 
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジーDBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジーMasaya Ishikawa
 
[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介
[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介
[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介Insight Technology, Inc.
 
[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...
[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...
[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...Insight Technology, Inc.
 
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...Insight Technology, Inc.
 
[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...
[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...
[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...Insight Technology, Inc.
 
[db tech showcase Tokyo 2015] D22:インメモリープラットホームSAP HANAのご紹介と最新情報 by SAPジャパン株式...
[db tech showcase Tokyo 2015] D22:インメモリープラットホームSAP HANAのご紹介と最新情報 by SAPジャパン株式...[db tech showcase Tokyo 2015] D22:インメモリープラットホームSAP HANAのご紹介と最新情報 by SAPジャパン株式...
[db tech showcase Tokyo 2015] D22:インメモリープラットホームSAP HANAのご紹介と最新情報 by SAPジャパン株式...Insight Technology, Inc.
 
[db tech showcase Tokyo 2015] C16:Oracle Disaster Recovery at New Zealand sto...
[db tech showcase Tokyo 2015] C16:Oracle Disaster Recovery at New Zealand sto...[db tech showcase Tokyo 2015] C16:Oracle Disaster Recovery at New Zealand sto...
[db tech showcase Tokyo 2015] C16:Oracle Disaster Recovery at New Zealand sto...Insight Technology, Inc.
 
[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...
[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...
[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...Insight Technology, Inc.
 
[db tech showcase Tokyo 2015] B24:最高峰の可用性 ~NonStop SQLが止まらない理由~ by 日本ヒューレット・パ...
[db tech showcase Tokyo 2015] B24:最高峰の可用性 ~NonStop SQLが止まらない理由~ by 日本ヒューレット・パ...[db tech showcase Tokyo 2015] B24:最高峰の可用性 ~NonStop SQLが止まらない理由~ by 日本ヒューレット・パ...
[db tech showcase Tokyo 2015] B24:最高峰の可用性 ~NonStop SQLが止まらない理由~ by 日本ヒューレット・パ...Insight Technology, Inc.
 

Viewers also liked (20)

Couchbase introduction-20150611
Couchbase introduction-20150611Couchbase introduction-20150611
Couchbase introduction-20150611
 
Mongodb x business
Mongodb x businessMongodb x business
Mongodb x business
 
[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...
[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...
[db tech showcase Tokyo 2015] D32:HPの全方位インメモリDB化に向けた取り組みとSAP HANAインメモリDB の効果を...
 
Db tech showcase2015
Db tech showcase2015Db tech showcase2015
Db tech showcase2015
 
Db tech show - hivemall
Db tech show - hivemallDb tech show - hivemall
Db tech show - hivemall
 
[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...
[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...
[db tech showcase Tokyo 2015] D33:Superdome X 上の SQL Server 2014 OLTP 検証結果と S...
 
[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...
[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...
[db tech showcase Tokyo 2015] E26 Couchbaseの最新情報/JBoss Data Virtualizationで仮想...
 
[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...
[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...
[db tech showcase Tokyo 2015] C15:DevOps MySQL in カカクコム~ OSSによる可用性担保とリアルタイムパフ...
 
[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...
[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...
[db tech showcase Tokyo 2015] D16:マイケルストーンブレーカー発の超高速データベースで実現する分析基盤の簡単構築・運用ステ...
 
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
[DB tech showcase Tokyo 2015] B37 :オンプレミスからAWS上のSAP HANAまで高信頼DBシステム構築にHAクラスタリ...
 
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジーDBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
DBTS2015 Tokyo DBAが知っておくべき最新テクノロジー
 
[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介
[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介
[db tech showcase Tokyo 2015] C27:楽天MySQL Backup Structure by 楽天株式会社 粟田啓介
 
[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...
[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...
[db tech showcase Tokyo 2015] C33:ビッグデータ・IoT時代のキーテクノロジー、CEPの「今」を掴む! by 株式会社日立...
 
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
[db tech showcase Tokyo 2015] A33:Amazon DynamoDB Deep Dive by アマゾン データ サービス ...
 
[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...
[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...
[db tech showcase Tokyo 2015] B36:Hitachi Advanced Data Binder 実践SQLチューニング方法 ...
 
[db tech showcase Tokyo 2015] D22:インメモリープラットホームSAP HANAのご紹介と最新情報 by SAPジャパン株式...
[db tech showcase Tokyo 2015] D22:インメモリープラットホームSAP HANAのご紹介と最新情報 by SAPジャパン株式...[db tech showcase Tokyo 2015] D22:インメモリープラットホームSAP HANAのご紹介と最新情報 by SAPジャパン株式...
[db tech showcase Tokyo 2015] D22:インメモリープラットホームSAP HANAのご紹介と最新情報 by SAPジャパン株式...
 
[db tech showcase Tokyo 2015] C16:Oracle Disaster Recovery at New Zealand sto...
[db tech showcase Tokyo 2015] C16:Oracle Disaster Recovery at New Zealand sto...[db tech showcase Tokyo 2015] C16:Oracle Disaster Recovery at New Zealand sto...
[db tech showcase Tokyo 2015] C16:Oracle Disaster Recovery at New Zealand sto...
 
[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...
[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...
[db tech showcase Tokyo 2015] B27:インメモリーDBとスケールアップマシンによりBig Dataの課題を解決する by S...
 
[db tech showcase Tokyo 2015] B24:最高峰の可用性 ~NonStop SQLが止まらない理由~ by 日本ヒューレット・パ...
[db tech showcase Tokyo 2015] B24:最高峰の可用性 ~NonStop SQLが止まらない理由~ by 日本ヒューレット・パ...[db tech showcase Tokyo 2015] B24:最高峰の可用性 ~NonStop SQLが止まらない理由~ by 日本ヒューレット・パ...
[db tech showcase Tokyo 2015] B24:最高峰の可用性 ~NonStop SQLが止まらない理由~ by 日本ヒューレット・パ...
 
Presto in Treasure Data
Presto in Treasure DataPresto in Treasure Data
Presto in Treasure Data
 

Similar to gen_paxos

The Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 ExpoThe Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 ExpoVenture Hacks
 
GIPA
GIPAGIPA
GIPAESUG
 
2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By Step2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By StepEric Ries
 
OpenSRF and Evergreen
OpenSRF and EvergreenOpenSRF and Evergreen
OpenSRF and EvergreenEvergreen ILS
 
Product Management In Scrum Kozlov
Product Management In Scrum KozlovProduct Management In Scrum Kozlov
Product Management In Scrum KozlovAlexey Krivitsky
 
Scalability without going nuts
Scalability without going nutsScalability without going nuts
Scalability without going nutsJames Cox
 
High Performance Kick Ass Web Apps (JavaScript edition)
High Performance Kick Ass Web Apps (JavaScript edition)High Performance Kick Ass Web Apps (JavaScript edition)
High Performance Kick Ass Web Apps (JavaScript edition)Stoyan Stefanov
 
UW ADC - Course 3 - Class 1 - User Stories And Acceptance Testing
UW ADC - Course 3 - Class 1 - User Stories And Acceptance TestingUW ADC - Course 3 - Class 1 - User Stories And Acceptance Testing
UW ADC - Course 3 - Class 1 - User Stories And Acceptance TestingChris Sterling
 
Geometric Algebra 2: Applications
Geometric Algebra 2: ApplicationsGeometric Algebra 2: Applications
Geometric Algebra 2: ApplicationsVitor Pamplona
 
2007 0822 Antelope Php
2007 0822 Antelope Php2007 0822 Antelope Php
2007 0822 Antelope Phpgmaxsonic
 
『Ficia』インフラとPerlにまつわるエトセトラ
『Ficia』インフラとPerlにまつわるエトセトラ『Ficia』インフラとPerlにまつわるエトセトラ
『Ficia』インフラとPerlにまつわるエトセトラMasaaki HIROSE
 
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)jjhuff
 
Really Simple Document Management with Alfresco
Really Simple Document Management with AlfrescoReally Simple Document Management with Alfresco
Really Simple Document Management with AlfrescoAlfresco Software
 
E M T Better Performance Monitoring
E M T  Better  Performance  MonitoringE M T  Better  Performance  Monitoring
E M T Better Performance MonitoringPerconaPerformance
 
The Yahoo Open Stack
The Yahoo Open StackThe Yahoo Open Stack
The Yahoo Open StackMegan Eskey
 
Robust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesRobust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesSangjin Lee
 

Similar to gen_paxos (20)

The Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 ExpoThe Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 Expo
 
GIPA
GIPAGIPA
GIPA
 
2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By Step2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By Step
 
OpenSRF and Evergreen
OpenSRF and EvergreenOpenSRF and Evergreen
OpenSRF and Evergreen
 
HTML Parsing With Hpricot
HTML Parsing With HpricotHTML Parsing With Hpricot
HTML Parsing With Hpricot
 
Product Management In Scrum Kozlov
Product Management In Scrum KozlovProduct Management In Scrum Kozlov
Product Management In Scrum Kozlov
 
Scalability without going nuts
Scalability without going nutsScalability without going nuts
Scalability without going nuts
 
Java/Swing
Java/SwingJava/Swing
Java/Swing
 
High Performance Kick Ass Web Apps (JavaScript edition)
High Performance Kick Ass Web Apps (JavaScript edition)High Performance Kick Ass Web Apps (JavaScript edition)
High Performance Kick Ass Web Apps (JavaScript edition)
 
UW ADC - Course 3 - Class 1 - User Stories And Acceptance Testing
UW ADC - Course 3 - Class 1 - User Stories And Acceptance TestingUW ADC - Course 3 - Class 1 - User Stories And Acceptance Testing
UW ADC - Course 3 - Class 1 - User Stories And Acceptance Testing
 
NRCP Website- What is Available, Where we are Going and How it Can Help You
NRCP Website- What is Available, Where we are Going and How it Can Help YouNRCP Website- What is Available, Where we are Going and How it Can Help You
NRCP Website- What is Available, Where we are Going and How it Can Help You
 
SEASR and UIMA
SEASR and UIMASEASR and UIMA
SEASR and UIMA
 
Geometric Algebra 2: Applications
Geometric Algebra 2: ApplicationsGeometric Algebra 2: Applications
Geometric Algebra 2: Applications
 
2007 0822 Antelope Php
2007 0822 Antelope Php2007 0822 Antelope Php
2007 0822 Antelope Php
 
『Ficia』インフラとPerlにまつわるエトセトラ
『Ficia』インフラとPerlにまつわるエトセトラ『Ficia』インフラとPerlにまつわるエトセトラ
『Ficia』インフラとPerlにまつわるエトセトラ
 
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
 
Really Simple Document Management with Alfresco
Really Simple Document Management with AlfrescoReally Simple Document Management with Alfresco
Really Simple Document Management with Alfresco
 
E M T Better Performance Monitoring
E M T  Better  Performance  MonitoringE M T  Better  Performance  Monitoring
E M T Better Performance Monitoring
 
The Yahoo Open Stack
The Yahoo Open StackThe Yahoo Open Stack
The Yahoo Open Stack
 
Robust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the TrenchesRobust and Scalable Concurrent Programming: Lesson from the Trenches
Robust and Scalable Concurrent Programming: Lesson from the Trenches
 

Recently uploaded

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Recently uploaded (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

gen_paxos

  • 1. gen_paxos kuenishi   2009/7/3 3rd Erlang‐meeting in  Shirogane‐takanawa, Tokyo 
  • 2.   kuenishi@gmail.com         Erlang Python   See id:kuenishi, g:erlang:id:kuenishi, @kuenishi    http://github.com/kuenishi    http://bitbucket.org/kuenishi    Recent Activities    Yet another TC‐Erlang binding    http://bitbucket.org/kuenishi/yatce/    Mercurial l10n    1.3 has been released on 7/1!    http://bitbucket.org/foozy/mercurial‐translation‐ja/  2 
  • 3. Outline   Introduction    Why PAXOS?    What is PAXOS?    How can we implement PAXOS?    Why Erlang?    Where is PAXOS?    When?    Appendix    Notice: Basically English, Sometimes Japanese  3 
  • 4. Introduction – what is gen_paxos?   GENeric PAXOS module written in Erlang    Reduction of the cost of re‐invention of wheels.    At first, I had aimed to make it sth like ‘behaviour’    http://github.com/kuenishi/gen_paxos    Related works (I think not enough)     libpaxos    gen_leader    Why not enough?  4 
  • 5. Why PAXOS?   Split Brain    Typically, broken switches / wires    Both master and slave updates independently ID name addr ID name addr 0 Hage 0 Hage 1 hoge 1 hoge … … … … … … Replication Master Replication Slave Data Inconsistency! Ouch! 5 
  • 6. Why PAXOS? – cont’d   Split Brain Problem    Separate actors can’t coordinate    Lacking coordination ‐> Multi‐master    Multi‐master ‐> Data Inconsistency    Inconsistency ‐> Tragedy    Typically, BigTable solely depends upon Chubby[2]    BigTable’s Master Election, so on.    Byzantine Generals Problem    A faulty actor who lies destroys consistency    I don’t know current implementation of gen_paxos solves  this problem – not in scope    See Byzantine PAXOS in Wikpedia[6] 6 
  • 7. What is PAXOS?   Distributed Consensus/Coordination Algorithm    Masterless (no SPOF)    Robust to split brain environment such as network  separation    Proved to converge within infinite time period[9]    Works iff majority of fixed group of actors is alive  and communicable  7 
  • 8. What is PAXOS? – Example   Two phase election – phase 1    Larger n is prior  21:32 21:36 n=3 21:35 n=2 JK n=1 21:36 21:38 orz orz 8 
  • 9. What is PAXOS? – Example   Two phase election – phase 2     confirmation  n=4 21:43 21:43 … 21:41 proposer 21:42 21:44 21:43 9 
  • 10. What is PAXOS? – data model in gen_paxos   Actors    n processors with processor ID    Data    Instance ID (Subject)    Proposal ID (N)    Proposal itself (Value)    N should be unique  ID 1 2 3 4 5   At first, V differs  n(1) 1 2 3 4 5   later V converges n(2) 6 7 8 9 10 n(3) 11 12 13 14 15 n(4) 16 17 18 19 20 n(…) … … .. … .. 10 
  • 11. What is PAXOS? – details in gen_paxos   Basic sequence of Each actor    Prepare Phase    If Prepare comes, agree or disagree  be Acceptor     If Prepare doesn’t come, send Prepare  be Proposer     If majority of group agrees Prepare, send Propose    If timeout, increase n and restart Prepare phase    Propose Phase    Acceptor – agree to Propose (ignoring lower n)    Proposer – decided if majority agrees    If timeout, increase n and restart Prepare phase    Commit Phase    Send the committed Value again to notify 11 
  • 12. What is PAXOS? – details in gen_paxos   Basic sequence of Each actor    Prepare Phase    Prepare Acceptor     Prepare Prepare Proposer     Prepare Propose    n     Propose Phase    Acceptor ‐ Propose n     Proposer ‐      n Prepare Phase     Commit Phase    12 
  • 13. What is PAXOS? – details in gen_paxos   Basic sequence of Each actor    Prepare Phase    Prepare Acceptor     Prepare Prepare Proposer     Prepare Propose    n     Propose Phase    Acceptor ‐ Propose     Proposer ‐      n Prepare Phase     Commit Phase    13 
  • 15. How can we implement PAXOS? (1/2) 1. Make a State Diagram  [State] {Action, NextState} [Event] Define:  • {State, Event} ‐> {NextState, Action} 15 
  • 16. How can we implement PAXOS? (2/2) 2.  Write an FSM code  Define a set of  Module:State/2  Module:State(Event, Data)      ‐> {next_state,   NextState, NextData}  (See paxos_fsm.erl for details) 16 
  • 17. Process Architecture of a Node (gen_paxos.erl)   A‐little‐bit load balancing    Not pursuing consensus performance    Thinkin’bout Chubby[5] (no dynamic node addition/removal)  gen_fsm:start_link/4 gen_fsm starts for Creates gen_fsm after  each subject receiving message  Sends message after  balancing with  paxos_fsm(Key) erlang:phash(Key,3) coordinator0 coordinator1 coordinator2 puts the result into process gen_paxos.erl dictionary after receiving message User process Sends message  after getting  {Key, Value}  consensus  17 
  • 18. Messaging between nodes (paxos_fsm.erl)   FSMs talk each other by sending events with globalname()    globalname() = {global, GlobalName}   GlobalName is for first argument of gen_fsm:start_link/4    gen_fsm:send_event/2 sends Events to remote nodes    gen_fsm:send_event({global, GlobalName}, Event). – that’s all.    Anyway, no need to design application protocol, object  serialization, nor GoF ‘State, Observer’ pattern! That’s  WHY ERLANG!!  gen_fsm:send_event/2 nodeA nodeB nodeC paxos_fsm paxos_fsm paxos_fsm coordinators coordinators coordinators User User User process process process 18 
  • 19. Sample code – paxos_fsm.erl • acceptor {prepare, {S,N,V,From}} N • prepare_result • N V acceptor 19 
  • 21. Where is PAXOS?   Paxon Isles in Aegean Sea[1]    ‘the part‐time parliament’[3] 21 
  • 22. Where is PAXOS? cont’d   Looks so nice place to visit! 22 
  • 23. When?? ‐ References   [1]PAXOS island    http://www.paxos‐greece.com/    [2]Google, The Chubby Paper, 2006.    [3]Leslie Lamport, `The Part‐Time Parliament’, ACM Trans. Comput. Syst.  Volume 16 ,  Issue 2  (May 1998) , pp. 133 – 169.    [4]Leslie Lamport, `Paxos Made Simple’, SIGACT News, Vol. 32, No. 4.  (December 2001), pp. 51‐58.    [5]T Chandra et al., `Paxos made live: an engineering perspective’, PODC  '07, ACM Press, 2007, pp. 398‐407.    [6]Wikipedia, `Paxos_algorithm’,     http://en.wikipedia.org/wiki/Paxos_algorithm    1990     [7]Lamport’s patent  M$…     http://www.j‐tokkyo.com/2005/G06F/JP2005‐196763.shtml    [8]David Mazieres, `Paxos Made Practical’, tech report, 2007.    http://net.pku.edu.cn/~course/cs501/2008/reading.html    [9]Dwork, Cynthia et al., `Consensus in the presence of partial  synchrony’, J. ACM 35‐2, pp. 288—323, 1988.     Other implementations    single‐phase majority‐voting is used in distributed memory, distributed CPU;  rather hardware.    libpaxos  23 
  • 24.   Any Questions? http://creativecommons.org/licenses/by‐sa/2.1/jp/ 24 
  • 25. appendix Known Bugs FAQ State Diagram
  • 26. Appendix – Known Bug(s)           
 
 
 26 
  • 27. Appendix – FAQ   
 
     
           ?DEFAULT_TIMEOUT #state 27 
  • 29.   Thanks!  http://creativecommons.org/licenses/by‐sa/2.1/jp/ 29