Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Describing Composite Events Dealing with composite events, we need to take two different issues into account : Describe compositions Collect primitive events and subsequently match them to subscriptions Pietzuch et al. have proposed a general framework for event composition in distributed systems
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Describing Composite Events Figure Examples of events in a distributed system. S1 : primitive discrete event S2 : simple composition of two discrete events S3 : more complex, it requires that the system can also report time-related events S4 & S5 : require for computing gradients or average, and also need to monitoring the system
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Describing Composite Events Figure The finite state machine for subscription S3 from Fig
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Describing Composite Events FSM can often be decomposed into smaller FSMs that communicate by passing events to each other
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Describing Composite Events Figure Two coupled FSMs.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Describing Composite Events Consider a publish/subscribe system supporting composite events : To match events and subscriptions, we can allow a simple, naïve implementation in which every subscriber runs a process implementing the finite state machine associated with it subscription ( 但是沒效率 ) A much better approach is to consider the complete collection of subscriptions, and decompose subscriptions into communicating finite state machines (distributed event detectors)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Consistency and Replication
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved General Considerations to Static Approaches An efficient distributed implementation of a JavaSpace has to solve two problems: 1.How to simulate associative addressing without massive searching. 2.How to distribute tuple instances among machines and locate them later.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved JavaSpace 結構 Hash : 拿第 i 個 field 的前幾個 byte 做 hash Field : 指向一個 object 要做 read, write, take 時,藉 由計算 hashing function ( 套入 第 i 個 field) ,從 hash table 中 找出所要的 object
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved General Considerations to Static Approaches Figure A JavaSpace can be replicated on all machines. The dotted lines show the partitioning of the JavaSpace into subspaces. (a) Tuples are broadcast on write.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved General Considerations to Static Approaches Figure A JavaSpace can be replicated on all machines. The dotted lines show the partitioning of the JavaSpace into subspaces. (b) reads are local, but the removing an instance when calling take must be broadcast.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved General Considerations to Static Approaches Figure Nonreplicated JavaSpace. (a) A write is done locally.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved General Considerations to Static Approaches Figure Nonreplicated JavaSpace. (b) A read or take requires the template tuple to be broadcast in order to find a tuple instance.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved General Considerations to Static Approaches Figure Partial broadcasting of tuples and template tuples. Partial Replication C :特選 tuple
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Dynamic Replication
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved GSpace GSpace is a distributed coordination-based system that is built on top of javaSpaces. GSpace is done for two reasons Improving performance availability For this reason, the architecture of GSpace has been set up to support a variety of replication policies, and such that different tuples may follow different policies.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved GSpace Overview Figure Internal organization of a GSpace kernel.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Adaptive Replication 系統自動根據 access pattern 判斷適用哪種 policy ex :根據目前頻寬、記憶體使用量、 tuple 的目前狀況 Transition policies 使用某 policy 之後,中途轉換 policy
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Fault Tolerance 建立一個 Reliable Publish-Subscribe Communication 兩個要 點 Reliable multicast channel Process fault tolerance needs to be handled TIB/Rendezvous assumes that communication facilities of the underlying network are inherently unreliable Send daemon 保留 message 60 秒, 若 message 傳送過程中 loss, 由 Receive daemon 發送 retransmit 訊息要求重送 超過 60 秒再要求重送會收不到 Example : PGM (Pragmatic General Multicast) 不完全保證 multicast message 之後一定送到的接收端 藉由使用多個 PGM Router 收集各區域的 retransmission ,並將相同的 retransmission request 整合成一個傳送給 sender 要求重送 細部路徑由各 Router 自行記住
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Example: Fault Tolerance in TIB/Rendezvous Figure The principle of PGM. (a) A message is sent along a multicast tree.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Example: Fault Tolerance in TIB/Rendezvous Figure The principle of PGM. (b) A router will pass only a single NAK for each message.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Example: Fault Tolerance in TIB/Rendezvous Figure The principle of PGM. (c) A message is retransmitted only to receivers that have asked for it.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Fault Tolerance in Shared Dataspaces 以前要滿足 fault tolerance 的需求,大部分都是使用 central server 同步化或是還原點的方式 如今所使用的方式是利用 replication 將 tuple 分散在各個機器 上,在這裡課本提出一個計算該系統內 node 的 availability 的 方式 Availability node = MTTF / ( MTTF + MTTR ) 圖如下一頁
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Fault Tolerance in Shared Dataspaces Figure The time line of a node experiencing failures.