分布式儲存系統設計 反熵 (Anti-Entropy)

來源:互聯網
上載者:User

轉載:http://www.360doc.com/content/12/0614/14/7936054_218097481.shtml

Anti-Entropy 機制被用來保證在不同節點上的備份(replica)都持有最新版本。

由於涉及的處理很大,一般情況下,這種機制只用於永久性的錯誤恢複,而不用於普通的 read repair。如同 amazon
dynamo
一樣。

另外,為了將節點間的資料轉送降到最低,在實際資料轉送前,各節點交換的是自己那份資料的message digest。實現中將採用 MerkleTree (其葉子節點儲存的是資料檔案,而非葉子節點儲存的是其子節點的 Message
Digest)

處理流程

1. recover過程從 Node A 建立一個repair
session

2. recover過程從 Node A 開始 repair

3. Node A從請求資訊中得到資料 replica所在的節點(例子中,除了 Node
A外,還有 Node B和 Node C)

4. 迭代這個 replica 節點列表

    4.1.通過本地的Message Service發送 anti-entropy 請求到 Node
B

       4.1.1 Node B接收並執行請求

    4.2.通過本地的Message Service發送 anti-entropy 請求到 Node C

        4.2.1 Node C接收並執行請求

    4.3.通過本地的Message Service發送 anti-entropy 請求到
本地 Node A(自己)

        4.3.1本地 Node A接收並執行請求

5. 初始化 MerkleTree

6. 對每行資料計算其 hash 值並加入到 merkleTree

7. 各節點將自己的MerkleTree作為 anti-entropy response 送給本地的Message Service

    7.1各節點的本地的Message Service將 anti-entropy response 返回給 Node
A 的Message Service

8. ode A收集各個 anti-entropy response 中的MerkleTree與本地的 MerkleTree
(4.3.1 收到為本地的) 的不同 (diff)

9. 如果需要, 通過 pipelineOut向
遠程節點發送更加新的資料

10. 如要需要,通過 pipelineIn向遠程節點請求理加新的資料

riak的評論:http://stackoverflow.com/questions/5486304/explain-merkle-trees-for-use-in-eventual-consistency

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.