行政院國家科學委員會補助專題研究計畫成果報告
※※※※※※※※※※※※※※※※※※※※※※※※※
※ ※
※ 分散式系統中以法團為基礎之複製控制機制研究 ※
※ ※
※※※※※※※※※※※※※※※※※※※※※※※※※
計畫類別:■個別型計畫 □整合型計畫 計畫編號:NSC-89-2213-E-011-018 執行期間:88 年 08 月 01 日至 89 年 07 月 31 日 計畫主持人: 邱舉明
共同主持人:
本成果報告包括以下應繳交之附件:
□赴國外出差或研習心得報告一份
□赴大陸地區出差或研習心得報告一份
□出席國際學術會議心得報告及發表之論文各一份
□國際合作研究計畫國外研究報告書一份
執行單位: 國立台灣科技大學 電機工程系
中 華 民 國 89 年 09 月 13 日
分散式系統中以法團為基礎之複製控制機制研究
A Study on Quorum-Based Replica Control Protocol in Distributed Sytems 計畫編號: NSC-89-2213-E-011-018
執行期間: 88/8/1 –89/7/31
主 持 人 :邱舉明 國立台灣科技大學電機工程系 教授 Email:[email protected]
計劃參與人員:林靜敏、蕭志明、黃紀強、陳玉城、歐仁傑 國立台灣科技大學電機工程系
一、中文摘要
以法團(quorum) 為基礎之複製控 制, 是管理分散式系統中資料複製的重 要方法。在本研究中,我們發展一套新的 法團機制。首先,我們提出,所謂差對 (difference pair)的觀念,以做為法團建制 的基礎。繼而,提出一簡單、又有效率的 模式,以供實際讀/寫法團群的構築。該模 式所建立之法團群具有對稱性
(symmetry),而且能適用於任何備份數目 的資料系統。更重要的是,在模式中,我 們加入了一項係數,此一係數的加入,允 許我們有彈性地調節讀/寫法團大小,以因 應系統實際讀/寫需求。
關鍵詞:區塊設計、法團群、循環集合、
法團一致性、複製控制。
Abstr act:
Quorum-based technique has been popular for enforcing consistency for replicated data in distributed systems. In this research, we develop a new quorum control system that is based on a concept called difference pair.
Further, we present an efficient and
practical model for constructing read/write coteries. The coteries generated are
symmetric, and the model may be used for systems with arbitrary numbers of data copies. More significantly, we introduce a parameter in the model, which allows us to adjust the sizes of read/write quorums
according to the actual read/write demand.
Keywor ds: Block design,quorum,cyclic set,quorum consensus,replica control . 二、計畫緣由與目的:
在分散式系統中,一筆資料可能由許 多使用者共享,而這些使用者也可能來自 不同的機器。假設這筆資料只有一個備份 (copy),如果這個備份所在之機器因損壞 而無法使用時,所有的工作都受到影響,
亦即資料的可用率(availability)會受損。此 外,由系統工作效能觀之,這單一備份必 須要負擔所有使用者對該筆資料的需 求,因此,很容易成為系統的瓶頸。如果 將一筆資料複製成多個備份,再將其備份 分別裝置在不同的機器上,即使有某些備 份損壞時,仍然還有其它好的備份可用,
則該資料之可用率必可增加,而且,系統 對該筆資料之使用強度,也由這些備份來 共同負擔,如此則可兩全其美。但是,資 料的複製相對地也產生了資料一致性
(consistency)問題。所謂資料一致性,其主 要的需求,就是要能達到,如同單一備份 連續(one- copy serializability)的特性。簡單 言之,也就是要讓所有的寫入(write)動作 有一先後次序,而每一個讀(read)的動作,
都能讀到最後被寫入的內容。因此,資料 複製系統就需要一套複製控制(replica control)機制,以維護系統之一致性。
有關複製控制方面的研究,已有許多 學者提出各種不同的機制。其中,法團式 控制機制(quorum-based mechanism)乃是 重 要的技術,所謂法團就是某些備份的集 合。在這類控制機制下,每一備份都附有 一版本序號(version number),該序號的初 始值為零,而隨著每一次的寫入動作遞 增,每一個寫入動作均需獲得某一寫法團 之所有備份的許可,才能把新的內容寫入 這一寫法團的每一備份中,然後,再把他
們的版本序號增加,而任一讀出動作,相 同地,也必需要有某一讀法團的所有備份 都允許時,才能取其中最新之資料內容(版 本序號最大者),作為讀出之值。為了保證 每次讀出的值都是最新寫入的資料,該讀 法團內必需至少包含一最後被寫入的備 份。這也就是說,任一讀法團必需與任一 寫法團有交集,此外,為了達到寫入動作 間的先後次序,任意兩個寫法團也必需要 有交集。
選舉機制(voting protocols)[10,26]是 最 早被提出的法團式控制機制,其優點是 具有很高的資料可用率,而其缺點在於讀 與寫法團的大小將隨著備份數量呈線性 遞增(linearly increasing),由於資料存取的 成本與法團大小成正比,故此種機制在備 份數量大時,成本很高。因此,有人就提 出了利用結構化的安排,以降低法團大小 的方法[2,6,7,13,16, 18,21,24,28]。這類方法 的特點是,把所有的備份依照某一結構安 排其位置,而讀、寫法團的建構,則利用 其結構特性,使之符合前述交集之要求。
這類方法各有其優缺點,但並無法同時滿 足下列之要求:適用於任意備份數目,平 均負荷,以及減低法團大小。
最近,有人提出一套基於組合數學 (combinatorial theory)中的循環差集(cyclic difference set)觀念的互斥機制[18]。其中,
利用一項修正的鬆弛差集(relaxed
difference set),來說明建構一循環式法團 所需的充分且必要條件。任一鬆弛差集均 可被用做建立其法團群的法團衍生集 合。 該機制提供各備份平衡的負荷,惟 其依賴耗時的窮舉搜尋(exhaustive search) 去尋找最佳的法團衍生集合,此外,該法 也不允許系統針對各別的需求,調配相關 的讀、寫法團大小。
本研究之目的,乃是針對前述方法不 足之處,發展一套簡單又有效率的法團式 複製控制方法,以同時達成下列目標 : (1) 每一備份均擔負同樣的負荷(load
balanced),亦即每一備份扮演同樣重 要的角色,以免過份依賴某部分備 份。
(2) 通用於任意數目備份之系統。
(3) 允許配合系統之讀/寫需求,調整讀
、寫法團的大小。
其中,第三項特性關係著系統整體運作成 本,例如,在一系統中,如果讀出的動作 要遠多於寫入的動作,則把讀法團調小 (相對地,讓寫法團大一點),對系統的效 能將有所幫助。前述的方法均不具有此一 特性。
三、結果與討論:
在本研究中,我們的機制主要是以延 伸自鬆弛差集的觀念為基礎,而鬆弛差集 的觀念,又來自於組合理論之循環差集。
以一具N個備份之系統來說,令
U={0,1,… , N-1}表示所有備份之集合。假 設A為U之子集合,一組由A衍生之循環集 合G(A),則定義如下:
G(A)={Ai| i∈U , Ai = {qa | qa= (a+i) mod N,
∀a∈A}},其中A則稱為G(A)的衍生集合
(generation set)。
在此,我們定義所謂差對(difference pair)的觀念如下:
定義:令C={c0,c1,… ,ck-1},而
D={d0,d1,… ,dl-1}為U之兩子集合。假設對 任一d∈U,都存在著一對(ci,dj),ci∈C,
dj∈D,而 ci–dj ≡d(mod N),則序對(C,D) 就叫做一差對。
我們稱一序對(R,W)為讀/寫對(read/
write pair),如果(R,W)及(W,W)均是差對的 話。讀/寫對有下列的特性:
定理一: 若且為若(R,W)是一讀/寫對,則其 衍生之循環集合對(G(R),G(W)),就形成一 讀/寫法團群。
由定理一得知,我們只要找到一讀/
寫對,就可以導出一套讀/寫法團群。問題 是,如果靠窮舉法去找讀/寫對的話,當系 統規模大的時候,成本就會很高。因此,
我們進一步提出了一實際又有效的模 式, 以方便建構讀/寫法團群,該模式可 以適用於任意備份數目的系統。在模式 中,我們加入一因數 m,1≤m≤ N,以提 供能調整讀/寫法團相對大小的特性。令
= m
l N ,
+
= m
k N 2
1 ,定義讀衍生集合 (read generation set)如下:
{0, 1,.... −1}
= l
g r r r
R ,r0 =0,0<ri+1−ri ≤m 2
0≤ ≤ −
∀ i l , 而0<N−rl−1≤m。又定 義寫衍生集合(write generation set)如下:
, 1 ,...., 2 , 1 , 0
{ −
= m
Wg w1,w2,...,wk−1}, 1
2 1< 1≤ −
− w m
m ,0<wi+1−wi ≤m 2
1≤ ≤ −
∀ i k , 而
2 1
1
≥ −
−
Wk N 。R 和g
W 有下列特性:g
定理二:對一m而言,任一讀/寫衍生集合 對(R ,g W )都是讀/寫對。g
當然,對一m值而言,可能存在多於 一讀衍生集合,同樣地,也可能存在多於 一寫衍生集合。由這些讀,寫衍生集合所衍 生的循環集合之聯集,也形成一讀/寫法團 群,而此整合成的讀/寫法團群,能有效的 提高系統的可用率。舉例而言,假設 N=13,
而m=4,則U={0,1,2,… ,12}。我們可以 建立兩個寫衍生集合W1={0,1,2,3,7} 及 W2={0,1,2,3,6},以及五個讀衍生集合 R1={0,4,8,12},R2={0,4,8,11},R3= {0,4,8,10},R4={0,4,7,11}及R5={0,4, 7,10},而(G(R1)∪G(R2)∪G(R3)∪G(R4)∪
G(R5),G(W1)∪G(W2)),就是一讀寫法團 群。
此外,我們針對前述模式加以分析,找 出m值與法團大小之間的關係。對一m值 而言,讀法團和寫法團的大小分別為l及 m+ k-1。當m增加時,讀法團會變小。分 析的結果顯示,最小的寫法團出現在
m=
+
2 N 1
時,而由此也得知最小的寫 法團大小為O( N)。相對於先前的方法, 我們的模式提供了許多的優點。
四、計劃成果自評:
本研究之內容是針對分散式系統,發 展一套同時具有下列特性之法團式複製 控制機制:1.平均負荷,2.適用於任意備 份數目,3.允許配合系統讀/寫需求,調整
讀寫法團大小。我們的研究所提出的方 法,不但達成上述需求,也有效地縮小了 法團的大小,而且所提出的模式也很簡 單,實際可行,成功地完成原計劃百分之 九十以上的目標。研究成果頗具學術價 值,也適用於大型分散式資料系統,適合 在學術期刊發表。
五、參考文獻:
[1] D. Agrawal and A. El Abbadi.
“Exploting Logical Structures in Replicated Databases”.
Information Processing Letters, 33(5):255-260,1990.
[2] D. Agrawal and A. El Abbadi. “An Efficient and Fault-tolerant Solution for Distributed Mutual Exclusion”. ACM Transactions on Computer System,9(1):1-20,Feb.
1991.
[3] Divyakant Agrawal,Ömer
Egecioglu,Amr El Abbadi. “Billiard Quorums on the Grid”. Information Processing Letters 64(1): 9-16 (1997)
[4] P. Bernstein and N. Goodman. “The Failure and Recovery Problem for Replicated Databases”. In Proc.
Second ACM Symp. Principles of Distributed Computing,pages 114-122,Aug.
1983.
[5] P.A. Bernstein,V. Hadzilacos,and N. Goodman. “Concurrency Control and Recovery in Database Systems”.
Addision-Wesley,1987. MA.
[6] S. Y. Cheung,M. H. Ammar,and M.Ahamad. “The Grid Protocol: A High Performance Scheme for maintaining Replicated Data”. IEEE Transactions on Knowledge and Data Engineering,4(6):582-592,Dec.
1992.
[7] Cheng-Hong Cho and Jer-Tsang Wang.
“Triangular Grid Protocol: An Efficient Scheme for Replica Control with Uniform Access Quorums”. In Euro-Par ’96 Parallel Processing Second International Euro-Par Conference Proceedings, pages 843-851,Aug. 1996.
[8] S. B. Davidson,H. Garcia-Molina,
and D. Skeen. “Consistancy in Partitioned Networks”. ACM
Computing Serveys,17(3):341-370,
Sep. 1985.
“How to Assign Votes in a
Distributed System”. Journal of the ACM,32(4):841-860,Oct. 1985.
[10] D.K. Gifford. “Weighted Voting for Replicated Data”. In Proceedings of the 7th ACM Symposium on Operating System Principles, pages 150-159,1979.
[11] Jehn-Ruey Jiang and Shing- Tsaan Huang,“Obtaining
nondominated k-coteries for fault-tolerant distributed k- mutual exclusion”,Proceedings 1994 International Conference on Parallel and Distributed Systems, p. 582-7,1994.
[12] Jehn-Ruey Jiang,Shing-Tsaan Huang and Yu-Chen Kuo. “Cohorts structures for fault-tolerant k entries to a critical section”,
IEEE Transactions on Computers, Vol: 46,Iss: 2,p. 222-8,1997.
[13] A. Kumar. “Hierarchical Quorum Consensus: A New Algorithm for Managing Replicated Data”.
IEEE Transactions on Computers, 40(9):996-1004,Sep. 1991.
[14] Yu-Chen Kuo and Shing-Tsaan Huang,“An improvement of Maekawa’s mutual exclusion algorithm to make it fault-tolerant”. Parallel Processing Letters,Vol. 3,No. 3,
p. 307-308,March 1993.
[15] Yu-Chen Kuo and Shing-Tsaan Huang,“A simple scheme to
construct k-coteries with O(square root N) uniform quorum sizes",
Information Processing Letters, Vol: 59,Iss: 1,p. 31-6,1996.
[16] Yu-Chen Kuo and Shing-Tsaan Huang. "A geometric approach for constructing coteries and k- coteries",IEEE Transactions on Parallel and Distributed Systems, Vol: 8,Iss: 4 ,p. 402-11,1997.
[17] Yu-Chen Kuo and Shing-Tsaan Huang. "Recognizing nondominated coteries and wr-coteries by availability",IEEE Transactions on Parallel and Distributed Systems,Vol:9,Iss: 8,p.721-8,
1998.
[18] Wai-Shing Luk and Tien-Tsin Wong. “Two New Quorum Based Algorithms for Distributed Mutual Exclusion”. In Int’l Conf. on
Distributed Computing Systems, pages 100-106,May 1997.
[19] Jr. Marshall Hall.
“Conbinatorial Theory”. John Wiley and Sons,1986,Chapter 11.
[20] N. C. Mendonca and R. O. Anido.
“Using Extended Hierarchical Quorum Consensus to Control Replicated Data: from Traditional Voting to Logical Structures”. In Proceedings of the 27th Annual Hawaii International Conference on System Science,pages 303-312,
1994.
[21] M. Maekawa,“A N0.5 Algorithm for Mutual Exclusion in
Decentralized System”. ACM Trans.
Computer System,3(1985) 145-159.
[22] M. L. Neilsen,M. Misuno,and M.Raynal. “A General Method to Define Quorums”. In Proceeding of the 12th International Conference on Distributed Computing Systems, pages 657-664,1992.
[23] Wee K. Ng and Chinya V.
Ravishankar. “Coterie Templates: A New Quorum Construction Method”.
ICDCS 1995: 92-99.
[24] David Peleg and Avishai Wool,
“Crumbling walls: a class of practical and efficient quorum systems”,Distributed Computing, Vol 10,p. 87-97,1997.
[25] R. Schlichting and F.
Schneider. “Fail-stop Processors”.
ACM Transactions on Computer Systems,1:303-312,1994.
[26] R. H. Thomas. “A majority Consensus Approach to Concurrency Control for Multiple Copy
Databases”. ACM Transactions on Database Systems,4(2):180-209,
Jun,1979.
[27] Chienwen Wu. “A Fault Tolerant O(N0.5) Algorithm for Distributed Mutual Exclusion”. In The 20th Annual International Phoenix Conference on Computers and Communications,pages 175-180,
1993.
[28] Y. T. Wu,Y. J. Chang,S.M.
Yuan,and H. K. Chang. “A New Quorum-Based Replica Control Protocol”. In Proceeding. Pacific Rim International Symposium on Fault-tolerant Systems,pages 116-121,Dec. 1997.