3. Result on YCSB-A (Read 50%, Blind update 50%)
CPU four Intel Xeon E7-8870 (total 144 logical cores)
Memory 1TB (no swap-out)
YCSB Table size 100K
YCSB Record size 8-bytes
Epoch size 1000ms
Contention (θ) 0.9 (highly contended)
# of threads to process txns 70
10. LineairDBのLogging: with Epoch Framework
?Log Formatに “所属するepoch”を入れておけば,
?
?Distributed LoggingしてもCommitはまとめて返せる
?
Distributed Logging
Worker
?
#1
Thread
Local Log
Buffer
Worker
?
#2
Thread
Local Log
Buffer
Worker
?
#3
Thread
Local Log
Buffer
#1 || #2 || #3
全WorkerのすべてのTxnsのロ
グが永続化されるまで,
Epochを進行させない
Wenting Zheng, Stephen Tu, Eddie Kohler, and Barbara Liskov. 2014. Fast databases with fast durability and
recovery through multicore parallelism. In Proceedings of the 11th USENIX conference on Operating Systems
Design and Implementation (OSDI'14). USENIX Association, USA, 465–477.
Commit Point
ここまで待てば,
ActiveなTXはおらず,
どの順番でCommitを
返しても問題なし
11. Disk-basedでよく用いられる“Fuzzy Checkpointing”は使えない.
?In-memory CheckpointingはConcurrency Controlの問題がある.
Checkpointing: Disk-based vs In-Memory
Committe
d
Disk-based Checkpointing In-Memory Checkpointing
Active
Transaction Log File(s)
Active
Active Txns Log は触らずに,
Committed Txns LogをPagesに反映させればOK.
Pages
Pages
TXN
Worker
TXN
Worker
TXN
Worker
x y z
Checkpointer
Checkpointerの処理は実質
ロングトランザクション.
Read Lockがなければ,
Consistent なCheckpoint
12. LineairDBのCheckpoint: with Epoch Framework
1ページにつき,2つのバッファを用意.(live/stable)
”checkpoint epoch” を定期的に作り,stable imageを作成.
In-Memory Checkpointing
TXN
Worker
TXN
Worker
TXN
Worker
x y z
Checkpointer
例えば:
1. 30秒おきに,Checkpoint
Epoch ceを作る.
2. ce に属するTxnsは,普段の
バッファに加えて “Stable
Image” も更新する.
3. ce が充分古くなったら,こ
れを読み出すだけで(Latch
なしで) Checkpoint完了
x y z
Live Images
Stable Images
Guna Prasaad, Badrish Chandramouli, and Donald
Kossmann. 2020. Concurrent Prefix Recovery: Performing
CPR on a Database. SIGMOD Rec. 49, 1 (March 2020),
16–23. DOI:https://doi.org/10.1145/3422648.3422653