sequenceDiagram
participant Client
participant Transaction Manager
participant Memtable
participant Raft Store
Client->>Transaction Manager: Start Transaction
Transaction Manager->>Transaction Manager: Assign read ts (timestamp)
loop For each read operation
Client->>Transaction Manager: Read(key)
Transaction Manager->>Raft Store: Get(key, read ts)
Raft Store-->>Transaction Manager: Return value (≤ read ts)
Transaction Manager-->>Client: Return value
end
Client->>Transaction Manager: Write(key, value)
Client->>Transaction Manager: Commit Transaction
loop For each key in write set
Transaction Manager->>Memtable: Get(key, read ts)
Memtable-->>Transaction Manager: Return latest ts for key
alt ts > read ts
Transaction Manager-->>Client: Abort Transaction
else ts ≤ read ts
Transaction Manager->>Memtable: Add to write set
end
end
Transaction Manager->>Memtable: Commit write set
Memtable->>Raft Store: Persist committed data
note over Memtable: Periodic Garbage Collection