6. 差分取得手法
• フルスキャン
a b c d e a b’ c d e’ 1 b’ 4 e’
• 差分ビットマップ使用
a b c d e a b’ c d e’ 1 b’ 4 e’
00000 01001
• WAL (Write-Ahead Log) 使用
a b c d e a b’ c d e’ 1 b’ 4 e’
1 b’ 4 e’
7
8. WalB Architecture
WalB Dev Any Application WalB Log
Controller (File System, DBMS, etc) Extractor
Control Read Write Log
Wrapper
Block Device
(WalB Dev)
Any Block Device Any Block Device
for Data (Data device) for Log (Log device)
Not special format An original format
10
10. WalB が満たすべき性質
• Read the latest written data
– 上書きされたはずの古いデータを読んではいけない
• Storage state uniqueness
– 歴史が変わらないこと(Log と Data の IO 順序)
• Durability of flushed data
– 永続化保証 フラグの要求を満たす
• Crash recovery without undo
– Undo ログなし,redo ログのみで一貫性を確保
12
12. IO 処理フロー (Easy)
Write
Submitted Completed
WalB write IO response
(Wait for overlapped IOs done)
Packed
Log IO response Data IO response
Time
Log submitted Log completed Data submitted Data completed
Read
Submitted Completed
Data IO response
Time
Data submitted Data completed
14
13. IO 処理フロー (Fast)
Write
Submitted Completed (Wait for overlapped IOs done)
WalB write IO response
Packed
Log IO response Data IO response
Time
Log submitted Log completed Data submitted Data completed
Pdata inserted Pdata deleted
Read
Submitted Completed
Data IO response
Time
(Data submitted) (Data completed)
Pdata copied 15
14. Pdata for Deferred Write
• Read the latest written data のため
– Fast algorithm のみ必要
• Read IO の挙動
– 重複する Write IO が pdata に存在したら
古い順に重複領域をコピー
– pdata に存在しない領域は data device から読む
16
15. 重複 IO 実行の直列化
Wait for overlapped IOs done
Data IO response
Time
Data submitted Data completed
Oldata inserted Got notice Oldata deleted Sent notice
• Storage State Uniqueness のために必要
• Oldata の insert/delete が FIFO であれば
IO につきカウンタひとつで制御可能
18
18. Pros and Cons
WalB Snapshot
Pdata/oldata
Read Index search
search/copy
Write twice (easy)
Index modification
Write
Pdata/oldata (+ old data copy)
modification (fast)
Get Index search and
diffs
Sequential read
Non-sequential read
Typical
Soft.
--- ZFS, BtrFS, (LVM)
WalB + Index ~= Block device with snapshot access 22