Optimistic Replication Systems Ice CubeWin FS MSROptimistic Replication
Optimistic Replication Systems ~ Ice. CubeとWin. FSのサーベイ ~ 金田 憲二
本発表の内容 MSR関連のOptimistic Replication Systems • Ice. Cube – Operation transfer型 • Win. FS – State transfer型
Ice. Cube Nuno Perguica, Marc Shapiro, and Caroline Matheson. Efficient Semantics-aware Reconciliation for Optimistic Write Sharing. MSRTR-2002 -52
A Motivating Scenario • 部屋予約システム – 可能な操作: 時刻と部屋を指定して予約を取る – Reconciliation: double bookingを回避する ユーザ 1 9: 00 room A 10: 00 room B or 10: 00 room C ユーザ 2 9: 00 room A 10: 00 room C 10: 00 room B reconciliation 10: 00 room C
我々が目指すReconciliation • 各操作の意味を考慮し、より柔軟に処理をする ユーザ 1 ユーザ 2 9: 00 room A or 9: 00 room B or 9: 00 room C 9: 00 room A 9: 00 room B reconciliation 9: 00 room C
Ice. Cube A general-purpose reconciliation engine 各操作の意味 (例、double bookingに関する制約) Ice. Cube reconcilable アプリケーション (例、部屋予約システム)
Ice. Cubeの動作概要 2. 各マシンがローカルの複製を更新する – 実行したアクションをログに記録する – 必要に応じてアクションに制約を課す 共有データ Alice Balance $1000 Balance $500 ひとまとめに実行 しなければいけない Balance $1000 Balance -$300 Brian Balance $200 どちらか片方しか 実行しない 残高は$0以上で なければならない アクションのログ Meeting on Oct. 13 for Alice and Brian Flight Reservation for Alice on Oct. 11 Debit Expense Account $500 Meeting on Oct. 13 for Alice and Brian Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500
Ice. Cubeの動作概要 3. Reconciliation i. 各マシンのアクションのログを集める 残高は$0以上で なければならない 共有データ Alice Balance $1000 Balance $500 ひとまとめに実行 しなければいけない Balance $1000 Balance -$300 Brian Balance $200 どちらか片方しか 実行しない 集計されたアクションのログ Meeting on Oct. 13 for Alice and Brian Flight Reservation for Alice on Oct. 11 Debit Expense Account $500 Meeting on Oct. 13 for Alice and Brian Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500
Ice. Cubeの動作概要 3. Reconciliation ii. 制約を満たすアクションの列(スケジュール)を 残高は$0以上で ユーザに(いくつか)提示する なければならない 共有データ Alice Balance $1000 Balance $500 ひとまとめに実行 しなければいけない Balance $1000 Balance -$300 Brian Balance $200 どちらか片方しか 実行しない 集計されたアクションのログ Meeting on Oct. 13 for Alice and Brian Flight Reservation for Alice on Oct. 11 Debit Expense Account $500 Meeting on Oct. 13 for Alice and Brian Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500
Ice. Cubeの動作概要 3. Reconciliation ii. 制約を満たすアクションの列(スケジュール)を ユーザに(いくつか)提示する 共有データ Alice Balance $1000 Balance $500 Balance $1000 Balance -$300 Brian Balance $200 スケジュール Meeting on Oct. 13 for Alice and Brian Flight Reservation for Alice on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500
Ice. Cubeの動作概要 3. Reconciliation iii. ユーザが選択したスケジュールを再実行し、 実行結果を各マシンに伝播させる 共有データ Alice Balance $0 Balance $500 Balance -$300 Brian Balance $0 スケジュール Meeting on Oct. 13 for Alice and Brian Flight Reservation for Alice on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500
共有データの状態 Balance = $600 スケジュール s = アクションの集合 a b c d e f Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = $600 スケジュール s = a をスケジュール a に追加 アクションの集合 a b c d e f Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = $600 スケジュール s = a c aに反するので a Flight Reservation for Brian on Oct. 12 を候補から外す c b Debit Expense Account $800 c Flight Reservation for Brian on Oct. 11 アクションの集合 d Debit Expense Account $500 e Flight Reservation for Brian on Oct. 10 f Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = $600 スケジュール s = a e aに反するので を候補から外す e アクションの集合 a b c d e f Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
-$200 共有データの状態 Balance = $600 スケジュール s = a b をスケジュール b アクションの集合 に追加 a b c d e f Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = -$200 スケジュール s = a b 動的な制約に反する アクションの集合 a b c d e f Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
$600 共有データの状態 Balance = -$200 スケジューリングを やり直す Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 スケジュール s = a b アクションの集合 a b c d e f まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = $600 スケジューリングを やり直す Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 スケジュール s = 制約違反の原因と b なった を アクションの集合 候補から外す a b c d e f まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = $600 スケジューリングを やり直す Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 スケジュール s = a⇒b なので a アクションの集合 も候補から外す a b c d e f まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = $600 スケジュール s = c をスケジュール c に追加 アクションの集合 a b c d e f Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = $500 スケジュール s = c e cに反するので を候補から外す e アクションの集合 a b c d e f Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = $500 スケジュール s = c f⇒eに反するので f アクションの集合 を候補から外す a b c d e f Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = $500 $100 スケジュール s = c d をスケジュール d に追加 アクションの集合 a b c d e f Flight Reservation for Brian on Oct. 12 Debit Expense Account $800 Flight Reservation for Brian on Oct. 11 Debit Expense Account $500 Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
共有データの状態 Balance = $100 スケジュール s = c d アクションの集合 a Flight Reservation for Brian on Oct. 12 が空になったので b Debit Expense Account $800 終了 c Flight Reservation for Brian on Oct. 11 アクションの集合 d Debit Expense Account $500 e f Flight Reservation for Brian on Oct. 10 Debit Expense Account $300 まとめて実行 (a⇒b ∧ b⇒a) ∧ (c⇒d ∧ d⇒c) ∧ (e⇒f ∧ f⇒e) 静的な制約 どちらか実行 ∧ (a c ∧ c a) ∧ (c e ∧ e c) ∧ (a e ∧ e a) 動的な制約 Balance >= 0
Win. FS Dahlia Malkhi and Doug Terry. Concise Version Vectors in Win. FS. In Proceedings of the 19 th International Symposium on Distributed Computing (DISC), 2005
A A Version Vectors方式での VV 1 依存関係の検出例1 0 A 1 B 0 C 0 e 1 A 0 A 1 B 0 同期 B 0 B 1 C 0 C 0 B 同期 VV 1 < VV 3 (e 1 ⇝ e 3) なのでo=3 e 2 A 0 C o : = 1 o : = 2 VV 3 A 1 B 0 同期 B 1 C 0 C 1 e 3 o : = 3
通信量・記憶容量の削減 (1/2) 全オブジェクトで一つのVersion Vectorを共有 o 1 o 2 o 3 A 0 0 0 B 0 0 0 A 1 0 1 B 0 0 0 e 1 o 1 : = 1 e 3 o 3 : = 1 A o 1 o 2 o 3 A 0 0 0 B 0 0 0 A 0 0 0 B 0 1 0 B e 2 o 2 : = 1 同期
発表のまとめ • Optimistic Replication Systemsのサーベイ – Ice. Cube – Win. FS
参考文献 • Efficient Semantics-aware Reconciliation for Optimistic Write Sharing – Nuno Perguica, Marc Shapiro, and Caroline Matheson – MSR-TR-2002 -52 • Concise Version Vectors in Win. FS – Dahlia Malkhi and Doug Terry – 19 th International Symposium on Distributed Computing, 2005 • Optimistic Replication – Yasushi Saito and Marc Shapiro – ACM Computing Surveys, 2005
- Slides: 68