OpenVMS
1753773 會員
5258 線上
108799 解決方案
發表新文章

shadow merge and shadow copy的差別

 
watermelonyu
教授

shadow merge and shadow copy的差別

shadow merge的機制上是怎樣做到的,

她是全部做比對,再把異動的部分抄寫

還是事先就知道異動的部分,只針對異動的部分抄寫

shadow merge跟shadow copy的優缺點比較

什麼環境下我該用哪一種機制?
1則回覆 1
watermelonyu
教授

shadow merge and shadow copy的差別

shadow merge 應稱為 shadow merge-copy. shadow copy 應稱為 shadow full-copy.



full-copy 是一個 block 一個 block copy,

merge copy 則是全部做比對,再把異動的部分抄寫.



你無法選擇用哪一種機制, 因為觸發的原因不同, Shadowing software 會自動選擇哪種 copy.



Full copy 是由使用者決定的, 如



- 新增 disk 至 shadowset



- shadowset member dismount then re-mount later



Merge copy 則是觸發於一或一個以上的主機沒有正常 dismount shadowset 時,



例如, 一個 cluster 由兩個 nodes 組成 (node-a, node-b), 兩個 nodes 均 mount 了 DSA0 (dka100/dka200, dka100 為 master). 若其中一個 node-a crash, 此時 node-b 並不知道 node-a 對 DSA0 的 write I/O 是否完成( 可能兩個 disks 均寫完了, 只寫完一個 disk, 或都還沒有), node-b 便會作 merge copy. node-b 若發現兩個 disks 有任何不一致則 dka100 -> dka200.



儘管觸發的原因不同, 但一旦開始執行, Full-copy 和 Merge-copy 用的方法相同, 如下



1. Read an LBN from the source disk

2. Read the same LBN from the target disk

3. Compare the LBNs from both disks

4. If the LBNs are different,

a. Write from the source disk to the target disk

b. Read the LBN just written from the target disk

c. Compare the source disk and target disk LBNs again

5. If the LBNs are the same, then start the process over for the next LBN from both disks.



但因為 merge copy 時 source disk 和 target disk 只有少數 LBNs 不同, 因此步驟 4 大多會被 skip!





為了改善 full-copy, OpenVMS 7.2-2(含) 以上支援了 Mini-copy.



為了改善 merge-copy OpenVMS 很早(至少 V5.5就有了) 便支援 Controller-assisted merge-copy (又稱 Mini-merge). OpenVMS 7.3-2(含) 以上又支援了 Host-based Mini-merge (HBMM).



以上三項改善均應用了 write-logging or write-bitmap 的方式 (類似 DB redo log 或 tracsaction log) 便可 "事先就知道異動的部分,只針對異動的部分抄寫", 一般僅需數秒便可完成 merge-copy!



詳細請參閱 OpenVMS volume shadowing Manual