An Automated Framework for Decomposing Memory Transac?ons to - - PowerPoint PPT Presentation

an automated framework for decomposing memory transac ons
SMART_READER_LITE
LIVE PREVIEW

An Automated Framework for Decomposing Memory Transac?ons to - - PowerPoint PPT Presentation

An Automated Framework for Decomposing Memory Transac?ons to Exploit Par?al Rollback Aditya Dhoke, Roberto Palmieri, and Binoy Ravindran Systems So)ware


slide-1
SLIDE 1

Aditya ¡Dhoke, ¡Roberto ¡Palmieri, ¡and ¡Binoy ¡Ravindran ¡

¡

Systems ¡So)ware ¡Research ¡Group ¡ Virginia ¡Tech ¡

An ¡Automated ¡Framework ¡for ¡Decomposing ¡ Memory ¡Transac?ons ¡to ¡Exploit ¡Par?al ¡Rollback ¡

IPDPS ¡2015 ¡

slide-2
SLIDE 2

2

Lock-based concurrency control has serious drawbacks

  • Coarse-­‑grained ¡locking ¡

– Simple, ¡but ¡no ¡concurrency ¡

Threads Time

Coarse-grained locking

  • Fine-­‑grained ¡locking ¡

– Excellent ¡performance, ¡but ¡ poor ¡programmability ¡ – Hard ¡to ¡compose ¡

Fine-grained locking

slide-3
SLIDE 3

3

Transac?onal ¡memory ¡promises ¡to ¡ alleviate ¡these ¡difficul?es ¡

  • Similar ¡to ¡ACID ¡transac?ons ¡
  • Easier ¡to ¡program ¡
  • Decent ¡performance ¡
  • Composable ¡

STM Fine-grained locking Coarse-grained locking

Threads Time

(PPoPP, ¡‘06) ¡ Herlihy ¡and ¡Moss, ¡‘93 ¡

slide-4
SLIDE 4

4

Transac?ons ¡can ¡be ¡nested ¡for ¡beVer ¡ composability, ¡performance, ¡… ¡

Sub-­‑transac?on ¡ Sub-­‑transac?on ¡ root-­‑transac?on ¡

@Atomic{ ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡Account ¡src ¡= ¡getAccount(a_src); ¡ ¡ ¡ ¡ ¡ ¡ ¡int ¡b_src ¡= ¡getBalance(src); ¡ ¡ ¡ ¡ ¡ ¡ ¡setBalance(b_src ¡-­‑ ¡X); ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡Account ¡dst ¡= ¡getAccount(a_dst); ¡ ¡ ¡ ¡ ¡ ¡ ¡int ¡b_dst ¡= ¡getBalance(dst); ¡ ¡ ¡ ¡ ¡ ¡ ¡setBalance(b_dst ¡+ ¡X); ¡ ¡ ¡ ¡} ¡ } ¡ ¡ (Moss ¡and ¡Hosking, ¡'06) ¡

slide-5
SLIDE 5

5

Several ¡nes?ng ¡models ¡exist ¡

  • Flat ¡nes?ng ¡
  • Closed ¡nes?ng ¡
  • Open ¡nes?ng ¡

¡

slide-6
SLIDE 6

6

Flat ¡nes?ng ¡is ¡no ¡nes?ng ¡

T1 T2 may proceed after T1 commits Flat inner transactions accessing a shared object T2 commit T1 successfully commits T2 must abort while T1 is still executing

Time ¡

slide-7
SLIDE 7

7

Closed ¡nes?ng ¡may ¡improve ¡ performance ¡

T1 Closed inner transactions accessing a shared object T2 commit T2's inner transaction may proceed after T1 commits T1 successfully commits T2's inner transaction must abort while T1 is still executing

Time ¡

slide-8
SLIDE 8

8

Open ¡nes?ng ¡may ¡perform ¡even ¡beVer, ¡ ¡ ¡ ¡ ¡ ¡ ¡ at ¡the ¡expense ¡of ¡physical ¡serializability ¡

T1 Open inner transactions accessing a shared object T2 T2's inner transaction only has to abort while T1's inner transaction is executing T2's inner transaction may proceed as soon as T1's inner transaction commits T1's inner transaction commits and releases its isolation T1 successfully commits T2 successfully commits

Time ¡

slide-9
SLIDE 9

9

Open ¡nes?ng ¡reduces ¡false ¡conflicts ¡ and ¡yields ¡abstract ¡serializability ¡

Transaction T1: Atomic { s.insert(x); s.insert(y); } Transaction T2: Atomic { s.insert(z); } Shared set s;

  • T1 ¡and ¡T2 ¡can ¡execute ¡and ¡commit ¡

concurrently iff x ≠ y ≠ z

  • But ¡T1 ¡and ¡T2 ¡traverse ¡same ¡physical ¡

structure ¡=> ¡physical ¡conflict ¡

– False ¡conflict ¡

Transaction T1: Atomic {

BeginNest_1

s.insert(x);

CommitNest_1

BeginNest_2

s.insert(y);

CommitNest_2

} Transaction T2: Atomic { s.insert(z); }

time

Abstract lock Abstract lock Abstract lock

a b c x y d z

Upon ¡CommitNest_1 ¡(and ¡CommitNest_2), ¡ read-­‑set ¡is ¡released ¡and ¡abstract ¡locks ¡acquired ¡ ¡ No ¡conflicts ¡on ¡a ¡,b, ¡c, ¡d, ¡but ¡only ¡on ¡x, ¡y ¡

slide-10
SLIDE 10

10

Paper’s ¡focus ¡is ¡on ¡closed ¡nes?ng ¡

  • If ¡there ¡is ¡a ¡conflict ¡on ¡

accessing ¡m3: ¡

– flat ¡nes?ng ¡will ¡restart ¡ from ¡T_flat ¡ – closed ¡nes?ng ¡will ¡restart ¡ T_closed, ¡saving ¡

  • pera?ons ¡on ¡m1 ¡and ¡m2 ¡
  • Root’s ¡commit ¡will ¡likely ¡

succeed ¡

  • Gains ¡can ¡be ¡significant ¡in ¡

distributed ¡systems ¡

– Object ¡lookup ¡involves ¡ network ¡communica?ons ¡

// ¡Matrices: ¡m1, ¡m2, ¡m3 ¡ ¡ @Atomic{ ¡// ¡T_flat ¡ ¡m1 ¡= ¡getObj(m1_Obj); ¡ ¡m2 ¡= ¡getObj(m2_Obj); ¡ ¡m3 ¡= ¡getObj(m3_Obj); ¡ ¡intm ¡= ¡add(m1,m2); ¡ ¡ ¡ ¡ ¡@Atomic{ ¡// ¡T_closed ¡ ¡result ¡= ¡add(intm,m3); ¡ ¡ ¡ ¡ ¡ ¡} ¡ } ¡

slide-11
SLIDE 11

11

But ¡sub-­‑transac?ons ¡have ¡to ¡be ¡ programmer-­‑defined ¡

  • Step ¡backwards! ¡

– Reduces ¡TM’s ¡high ¡programmability ¡

  • Closed ¡nes?ng ¡enables ¡par?al ¡abort ¡in ¡TM, ¡

poten?ally ¡increasing ¡performance ¡

  • Is ¡it ¡possible ¡to ¡automate ¡the ¡defini?ons ¡of ¡

closed ¡nested ¡transac?ons? ¡

– Increases ¡TM ¡performance, ¡retaining ¡high ¡ programmability ¡

slide-12
SLIDE 12

12

Contribu?on ¡is ¡ACN ¡

  • Automa?c ¡framework ¡for ¡composing ¡closed ¡

nested ¡transac?ons ¡

– Completely ¡programmer-­‑transparent ¡ – Heuris?c ¡algorithm ¡

  • Dynamic ¡framework ¡

– Op?mize ¡(closed-­‑nested) ¡transac?on ¡defini?on ¡at ¡ run-­‑?me ¡to ¡adapt ¡to ¡transac?onal ¡conten?ons ¡ and ¡workload ¡fluctua?ons ¡ – (Non-­‑trivial ¡to ¡do ¡so ¡manually) ¡

slide-13
SLIDE 13

13

Mul?ple ¡factors ¡affect ¡performance ¡of ¡ closed-­‑nested ¡transac?ons ¡

  • Nes?ng ¡granularity ¡

– # ¡opera?ons ¡performed ¡ ¡ ¡ ¡ ¡ ¡ by ¡a ¡sub-­‑transac?on ¡

  • Conten?on ¡ ¡

– Shared ¡objects ¡accessed ¡ ¡ ¡ ¡ ¡ by ¡a ¡sub-­‑transac?on ¡

  • Lexical ¡posi?on ¡ ¡

– Each ¡sub-­‑transac?on’s ¡ posi?on ¡in ¡root ¡

@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2.deposit(amt2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2.deposit(amt2); ¡ } ¡

Bank ¡benchmark’s ¡transac=on ¡ (flat ¡nes=ng) ¡

slide-14
SLIDE 14

14

Granularity ¡impacts ¡ ¡ performance ¡

Coarse ¡granularity: ¡ wrap ¡all ¡opera?ons ¡as ¡

  • ne ¡sub-­‑transac?on ¡

@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2.deposit(amt2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2.deposit(amt2); ¡ } ¡

NO ¡PARTIAL ¡ABORT! ¡

@Atomic{ ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1); ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2); ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1.withdraw(amt1); ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2.deposit(amt2); ¡ ¡ ¡ ¡} ¡ … ¡ } ¡

Finest ¡granularity: ¡ wrap ¡each ¡opera?on ¡ as ¡a ¡sub-­‑transac?on ¡

INEFFECTIVE! ¡

slide-15
SLIDE 15

15

Grouping ¡objects ¡with ¡similar ¡access ¡ probability ¡affects ¡performance ¡

System ¡hot ¡spots: ¡branch1, ¡branch2 ¡ Objects ¡less ¡contended: ¡account1, ¡account2 ¡ ¡ @Atomic{ ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡… ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡… ¡ ¡ ¡ ¡ ¡} ¡ } ¡

INEFFECTIVE! ¡

System ¡hot ¡spots: ¡branch1, ¡branch2 ¡ Objects ¡less ¡contended: ¡account1, ¡account2 ¡ ¡ @Atomic{ ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡… ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡… ¡ ¡ ¡ ¡ ¡} ¡ } ¡

EFFECTIVE! ¡

slide-16
SLIDE 16

16

Lexical ¡scoping ¡of ¡sub-­‑transac?ons ¡ also ¡affects ¡performance ¡

INEFFECTIVE! ¡

System ¡hot ¡spots: ¡branch1, ¡branch2 ¡ Objects ¡less ¡contended: ¡account1, ¡account2 ¡ @Atomic{ ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2); ¡ … ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡… ¡ ¡ ¡ ¡ ¡} ¡ } ¡

EFFECTIVE! ¡

System ¡hot ¡spots: ¡branch1, ¡branch2 ¡ Objects ¡less ¡contended: ¡account1, ¡account2 ¡ @Atomic{ ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡… ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡… ¡ ¡ ¡ ¡ ¡} ¡ } ¡

slide-17
SLIDE 17

17

Algorithm ¡composes ¡sub-­‑transac?ons ¡ from ¡code ¡blocks ¡

  • Transac?onal ¡code ¡is ¡composed ¡of ¡UnitBlocks ¡

– Smallest ¡logical ¡unit ¡of ¡code ¡involving ¡only ¡one ¡object ¡ ¡ – Includes ¡all ¡local ¡computa?ons ¡on ¡object ¡

@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2.deposit(amt2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2.deposit(amt2); ¡ } ¡ @Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2.deposit(amt2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2.deposit(amt2); ¡ } ¡

slide-18
SLIDE 18

18

Mul?ple ¡UnitBlocks ¡may ¡be ¡ ¡ combined ¡to ¡form ¡a ¡Block ¡

  • UnitBlocks ¡are ¡tagged ¡with ¡object ¡conten?on ¡levels ¡

– Measured ¡at ¡run-­‑?me ¡

  • UnitBlocks ¡with ¡comparable ¡conten?on ¡are ¡merged ¡

– Block: ¡smallest ¡executable ¡unit ¡of ¡code ¡

@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2.deposit(amt2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2.deposit(amt2); ¡ } ¡

UnitBlock

@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2.deposit(amt2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2.deposit(amt2); ¡ } ¡

Block

slide-19
SLIDE 19

19

Blocks ¡are ¡reordered ¡

  • Ordered ¡in ¡increasing ¡conten?on ¡level, ¡from ¡root ¡

– Ensuring ¡data ¡dependencies ¡

  • Safe, ¡as ¡transac?ons ¡are ¡all-­‑or-­‑nothing ¡

@Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2.deposit(amt2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2.deposit(amt2); ¡ } ¡ @Atomic{ ¡ ¡ ¡ ¡ ¡ ¡ ¡account1 ¡= ¡getObject(accountId1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2 ¡= ¡getObject(accountId2); ¡ ¡ ¡ ¡ ¡ ¡ ¡account2.deposit(amt2); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1 ¡= ¡getObject(branchId1 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch1.withdraw(amt1); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2 ¡= ¡getObject(branchId2 ¡); ¡ ¡ ¡ ¡ ¡ ¡ ¡branch2.deposit(amt2); ¡ } ¡

slide-20
SLIDE 20

20

Effec?veness ¡is ¡evaluated ¡at ¡run-­‑?me, ¡ and ¡recomposed ¡if ¡needed ¡

  • Current ¡Block ¡sequence ¡is ¡discarded ¡

– Merged ¡Blocks ¡are ¡split ¡

  • Adjacent ¡dependent ¡UnitBlocks ¡with ¡similar ¡

conten?on ¡levels ¡are ¡merged ¡ ¡

  • Blocks ¡are ¡sorted ¡in ¡increasing ¡order ¡of ¡(new) ¡

conten?on ¡level ¡ (Difficult ¡to ¡sta?cally ¡op?mize, ¡manually) ¡

slide-21
SLIDE 21

21

Case ¡study: ¡distributed ¡TM ¡sesng ¡

  • Distribu?on ¡has ¡several ¡mo?va?ons ¡

– Exploit ¡locality, ¡fault-­‑tolerance, ¡cope ¡with ¡ ¡ memory ¡constraints, ¡etc ¡

  • If ¡transac?ons ¡involve ¡remote ¡

communica?ons, ¡full ¡aborts ¡are ¡expensive! ¡

  • Excellent ¡problem ¡space ¡for ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

evalua?ng ¡par?al ¡abort ¡techniques ¡

– Closed ¡nes?ng ¡more ¡effec?ve ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ than ¡checkpoin?ng ¡(Dhoke, ¡‘13) ¡

slide-22
SLIDE 22

22

Quorum-­‑based ¡Replica?on ¡(QR) ¡is ¡ base ¡DTM ¡protocol ¡

  • Cost ¡of ¡synchroniza?on ¡is ¡higher ¡with ¡replica?on ¡

– Exemplified ¡in ¡QR ¡

Zhang, ¡‘11 ¡

Nodes ¡logically ¡organized ¡as ¡a ¡tree ¡ Nodes ¡belong ¡to ¡a ¡read ¡quorum ¡ and/or ¡a ¡write ¡quorum ¡ Quorums ¡intersect: ¡any ¡write-­‑q ¡and ¡ read-­‑q ¡always ¡intersect ¡ Commit ¡opera?on: ¡ Contact ¡a ¡write ¡quorum ¡to ¡ update ¡new ¡value ¡ Read/write ¡opera?on: ¡ Contact ¡a ¡read ¡quorum ¡to ¡ fetch ¡latest ¡object ¡version ¡

slide-23
SLIDE 23

23

Evalua?ons ¡used ¡TPC-­‑C ¡and ¡ ¡ manual ¡closed-­‑nes?ng ¡as ¡compe?tor ¡

  • Three ¡benchmarks: ¡

– TPC-­‑C ¡ – Vaca?on ¡(from ¡STAMP ¡suite) ¡ – Bank ¡

  • Compe?tors: ¡

– QR-­‑DTM ¡(flat ¡nes?ng) ¡ – QR-­‑CN ¡(manual ¡closed ¡nes?ng) ¡ – QR-­‑ACN ¡(automa?c; ¡reconfig ¡every ¡10secs) ¡

  • 30-­‑node ¡private ¡cluster ¡(8-­‑core ¡nodes; ¡1GBPS ¡link) ¡
slide-24
SLIDE 24

24

ACN ¡is ¡effec?ve ¡on ¡TPC-­‑C ¡ ¡ write ¡transac?ons ¡ ¡

20 40 60 80 100 10 20 30 40 50 Throughput (tx/sec) Time Interval (seconds) QR-DTM QR-CN QR-ACN

Block ¡containing ¡ updates ¡on ¡District ¡

  • bject ¡is ¡moved ¡to ¡

transac?on ¡end ¡

100% ¡New ¡Order ¡ Transac=ons ¡

200 300 400 500 600 700 800 10 15 20 25 30 35 40 45 50 Throughput (tx/sec) Time Interval (seconds) QR-DTM QR-CN QR-ACN

District ¡and ¡Warehouse ¡

  • bjects ¡ ¡are ¡most ¡

contended; ¡moved ¡ ¡ closer ¡to ¡transac?on ¡end ¡

100% ¡Payment ¡ Transac=ons ¡

50 55 60 65 70 10 20 30 40 50 Throughput (tx/sec) Time Interval (seconds) QR-DTM QR-CN QR-ACN

Delivery ¡transac?on ¡

  • bjects ¡have ¡similar ¡

conten?on; ¡ACN’s ¡ throughput ¡ changes ¡every ¡10s ¡

100% ¡Delivery ¡ Transac=ons ¡

slide-25
SLIDE 25

25

ACN ¡also ¡adapts ¡to ¡ ¡ workload ¡fluctua?ons ¡

Object ¡conten?on ¡varied ¡every ¡20s ¡ Manual ¡closed ¡nes?ng ¡cannot ¡ adapt; ¡worse ¡than ¡flat ¡ ¡

20 40 60 80 100 120 140 160 5 10 15 20 25 30 35 40 Throughput (tx/sec) Time Interval (seconds) QR-DTM QR-CN QR-ACN

STAMP-­‑Vaca=on ¡

ACN ¡is ¡always ¡best. ¡Even ¡if ¡most ¡ contended ¡Branches ¡are ¡changed ¡ every ¡20secs, ¡their ¡conten?on ¡is ¡ s?ll ¡higher ¡than ¡Accounts’ ¡

50 100 150 200 250 5 10 15 20 25 30 35 40 Throughput (tx/sec) Time Interval (seconds) QR-DTM QR-CN QR-ACN

Bank ¡

slide-26
SLIDE 26

26

Closed ¡nested ¡transac?ons ¡can ¡be ¡auto-­‑ composed, ¡with ¡effec?ve ¡performance ¡

  • Lightweight ¡technique ¡for ¡par?al ¡aborts ¡
  • Manual ¡composi?on ¡reduces ¡programmability ¡
  • Automa?on ¡ ¡

– Is ¡possible ¡(and ¡works!) ¡ – Can ¡run-­‑?me ¡op?mize ¡to ¡adapt ¡to ¡workload ¡changes ¡ – Is ¡par?cularly ¡effec?ve ¡in ¡distributed ¡sesngs ¡

  • Code ¡available ¡at ¡hyflow.org ¡
  • Auto-­‑compose ¡open-­‑nes?ng? ¡