infinite resources for optimistic concurrency control
play

Infinite Resources for Optimistic Concurrency Control with NOCC - PowerPoint PPT Presentation

Infinite Resources for Optimistic Concurrency Control with NOCC Theo Jepsen, Leandro Pacheco de Sousa, Masoud Moshref, Fernando Pedone, Robert Soul Universit della Svizzera italiana (USI) and Barefoot Networks Why Do We Need Concurrency


  1. Infinite Resources for Optimistic Concurrency Control with NOCC Theo Jepsen, Leandro Pacheco de Sousa, Masoud Moshref, Fernando Pedone, Robert Soulé Università della Svizzera italiana (USI) and Barefoot Networks

  2. Why Do We Need Concurrency Control? Deposit Deposit $100 $100 50 + 100 50 + 100 Account Balance $50 Should be Account Balance $250 $150 2

  3. Pessimistic Concurrency Control Deposit Deposit $100 $100 Account Balance 50 + 100 $50 150 + 100 Account Balance Locks hurt $150 concurrency Account Balance $250 3

  4. Optimistic Concurrency Control $50 $50 Read balance Read balance Account Balance 50 + 100 50 + 100 $50 (if balance is still $50) (if balance is still $50) Account Balance Abort! 150 + 100 $150 (if balance is still $150) Account Balance Retry $250 4

  5. Pessimistic vs Optimistic Concurrency Control OCC is better! OCC is It depends... better! Pessimistic is better! 5

  6. Pessimistic vs Optimistic Concurrency Control Pessimistic Optimistic Low contention High contention Aborts reduce throughput 6

  7. OCC: Aborts are Expensive Ideal OCC more clients→contention→more aborts→lower tput 7

  8. OCC With Infinite Resources ● What if we had infinite CPUs to abort transactions? ● Hardware can process aborts virtually instantly ● This hardware is already in the network 8

  9. Network OCC (NOCC) ● Offload transaction verification to the switch ● High parallelism for high-contention workloads ● Reduces server load for workloads (like TPC-C) 9

  10. System Model cache cache R() R() CMP(), W() CMP(), W() Balance $50 10

  11. The NOCC Approach ● Update cache with write values ● Update cache with ABORT values ● Early abort invalid transactions Update Update W(X) ABORT(X) cache CMP(X) Abort 11

  12. NOCC Example 50 50 R() R() 150 CMP(50), W(150) CMP(50), W(150) ABORT(50) Balance Balance $50 $150 12

  13. NOCC Correctness ● Strong consistency: ○ Reads are not handled by switch – no stale reads ● Liveness: ○ Transactions eventually commit 13

  14. Implementation 14

  15. Switch Implementation: Key Challenges ● Storing cached values on the switch ● Processing packet headers containing transactions 15

  16. Processing Transactions ● Each transaction contains one or more operations: ○ read(), cmp(), write() ● The P4 program iterates over the operations: ○ If invalid cmp() , abort transaction ○ If write() , update cache ● P4 doesn’t have iteration primitives ○ So we recirculate the packet 16

  17. Switch Cache ● We use SRAM registers ● Values (128 bits) are too large for a single register ○ So we shard the value across multiple registers Reg1 Reg2 Reg3 Reg4 val[0...31] val[32...63] val[64...95] val[95...128] 17

  18. Evaluation on Hardware 18

  19. Experimental Setup ● Clients and store run on seperate servers ● Connected via a Barefoot Tofino switch running NOCC ● Evaluated with microbenchmarks and TPC-C Client 19

  20. NOCC has Higher Throughput 20

  21. NOCC Reduces End-to-End Latency 21

  22. NOCC Reduces Aborts from the Store Commits all transactions 22

  23. NOCC Reduces Server Load for TPC-C 23

  24. Minimal Throughput Overhead for TPC-C 24

  25. In Conclusion, NOCC... ● Offloads transaction verification logic to the network ● Provides high throughput under high contention ● Reduces CPU load on the server https://github.com/usi-systems/nocc 25

  26. Extra Slides 26

  27. Packet Header Format The nocc_hdr is followed by a nocc_op header for each operation header_type nocc_hdr_t { fields { header_type nocc_op_t { bit<1> msg_type; // REQ/RES fields { bit<1> from_switch; bit<8> op_type; bit<32> txn_id; bit<32> key; bit<8> frag_seq; bit<1024> value; bit<8> frag_cnt; } bit<8> status; } bit<8> op_cnt; } Number of following } nocc_op headers 27

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend