Skip to content

FafnirDT extends the 2PLSF (Two-Phase Locking with Starvation Freedom) protocol to fix a critical scalability flaw in lock-based concurrency.

Notifications You must be signed in to change notification settings

Ryuichi-Yamafuji-Lun/FafnirDT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FafnirDT: Dynamic Timestamp in Lock-based Concurrency Control Protocols

🧠 Overview

FafnirDT extends the 2PLSF (Two-Phase Locking with Starvation Freedom) protocol to fix a critical scalability flaw in lock-based concurrency:

When all available threads are occupied by long transactions, 2PLSF can enter a state of zero throughput β€” no new transactions can be scheduled.

FafnirDT introduces:

  • A Dynamic Timestamp Tracker
  • Elastic arrays for announce timestamps and read indicators
  • A dedicated monitoring thread that injects new thread slots dynamically when delays are detected

βœ… Preserves serializability
βœ… Maintains starvation freedom
βœ… Recovers throughput under pathological workloads


πŸ’‘ Motivation

Problem: 2PLSF uses a fixed-size metadata array tied to CPU core count. If all threads are running long transactions, short transactions must wait β€” resulting in 0 TPS even when they could execute.

FafnirDT solves this by:

  • Monitoring global delay using a timer
  • Dynamically expanding metadata arrays
  • Injecting additional threads into the protocol, bypassing lockout

πŸ”¬ Experimental Setup

  • Architecture: x86_64
  • CPUs: 2Γ— Intel Xeon Gold 6130 @ 2.10GHz
  • Cores: 32 physical (64 logical)
  • Memory: 512 GB DRAM
  • Benchmark Tool: CCBench
  • Workload: YCSB (100% writes)
  • Dataset Size: 10,000 tuples

πŸ“ˆ Key Results

Scenario 2PLSF Throughput FafnirDT Throughput Notes
Normal Workload (short-only txns) ~470K TPS ~450K TPS ~4.65% overhead vs. 2PLSF
Delayed Threads (10s long txns) 0 TPS ~500K–610K TPS 2PLSF stalls; FafnirDT sustains full throughput
Thread Scaling (8 β†’ 64) under delay 0 TPS ~610K β†’ ~370K TPS Throughput degrades ~39.45%, but remains operational

πŸ“Œ Benchmarks: YCSB Write-Only, 10K tuples
πŸ“Œ Hardware: Dual Xeon Gold 6130, 512GB RAM, using CCBench


πŸ“‚ Usage Instructions

Usage instructions are provided in the main CCBench README at:
https://github.com/Ryuichi-Yamafuji-Lun/ccbench


βœ… TL;DR

FafnirDT is a systems-level enhancement to 2PLSF that dynamically injects threads and timestamps to restore throughput when all original threads are blocked by long transactions. It demonstrates:

  • Performance where 2PLSF yields zero
  • Elastic scalability on multicore systems
  • Minimal trade-offs under normal workloads

πŸ“¬ Contact

About

FafnirDT extends the 2PLSF (Two-Phase Locking with Starvation Freedom) protocol to fix a critical scalability flaw in lock-based concurrency.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published