Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

0

Share

Download to read offline

Bw-Tree Update Implementation

Download to read offline

Bw-Tree Update Implementation

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Bw-Tree Update Implementation

  1. 1. Scalable Computing Systems Laboratory Hanyang University Update Change 1
  2. 2. 2 Existing Update Method 1. TraverseReadOptimized() to check old & new value's existence 2. Traverse() to locate leaf node to insert 'delete delta' 3. update Mapping Table using CAS operation 4. Traverse() to locate leaf node to insert 'insert delta' 5. update Mapping Table using CAS operation ① TraverseReadOptimized() Node R
  3. 3. 3 Existing Update Method 1. TraverseReadOptimized() to check old & new value's existence 2. Traverse() to locate leaf node to insert 'delete delta' 3. update Mapping Table using CAS operation 4. Traverse() to locate leaf node to insert 'insert delta' 5. update Mapping Table using CAS operation ② Traverse() If <key, oldVal> does not exist: update() returns false Node R
  4. 4. PID Ptr L P R S 4 Existing Update Method Δ Δ delete Node R ③ CAS 1. TraverseReadOptimized() to check old & new value's existence 2. Traverse() to locate leaf node to insert 'delete delta' 3. update Mapping Table using CAS operation 4. Traverse() to locate leaf node to insert 'insert delta' 5. update Mapping Table using CAS operation Node R
  5. 5. 5 Existing Update Method Δ Δ delete PID Ptr L P R S Node R 1. TraverseReadOptimized() to check old & new value's existence 2. Traverse() to locate leaf node to insert 'delete delta' 3. update Mapping Table using CAS operation If CAS failed: repeat ② ~ ③ 4. Traverse() to locate leaf node to insert 'insert delta' 5. update Mapping Table using CAS operation Node R ③ CAS
  6. 6. 6 Existing Update Method 1. TraverseReadOptimized() to check old & new value's existence 2. Traverse() to locate leaf node to insert 'delete delta' 3. update Mapping Table using CAS operation 4. Traverse() to locate leaf node to insert 'insert delta' 5. update Mapping Table using CAS operation ④ Traverse() If <key, newVal> exists: update() assert fails Node R
  7. 7. PID Ptr L P R S 7 Existing Update Method Δ Δ delete Node R 1. TraverseReadOptimized() to check old & new value's existence 2. Traverse() to locate leaf node to insert 'delete delta' 3. update Mapping Table using CAS operation 4. Traverse() to locate leaf node to insert 'insert delta' 5. update Mapping Table using CAS operation If CAS failed: repeat ④ ~ ⑤ ⑤ CAS Δ insert Node R
  8. 8. PID Ptr L P R S 8 Existing Update Method Δ Δ delete Node R Δ insert Node R Problems 1. Operation is not atomic (2 CAS operations involved) Any operation accessing <key, newVal> or <key, oldVal> between first & second CAS will be failed. 2. Traverse() is called at least 3 times All traverse() returns same node.
  9. 9. 9 Existing Update Method Solutions 1. link Δ delete and Δ insert and use CAS only once to change Mapping Table. 2. Create new Traverse() that checks two <key, value> at once. Problems 1. Operation is not atomic (2 CAS operations involved) Any operation accessing <key, newVal> or <key, oldVal> between first & second CAS will be failed. 2. Traverse() is called at least 3 times All traverse() returns same node. PID Ptr L P R S Δ Δ delete Node R Δ insert Node R
  10. 10. 10 New Update Method ① NewTraverse() Node R 1. Use NewTraverse() that returns two <key, val> pairs There is 3 reason for update() to fail 1. NewTraverse() aborted, returning nullptr 2. <key, oldValue> does not exist 3. <key, newValue> already exist 2. Create Δdelete & Δinsert on top of base node without modifying Mapping Table 3. Use CAS operation to modify mapping table If CAS failed: repeat ① ~ ③
  11. 11. PID Ptr L P R S 11 New Update Method Δ Δ delete Node R Δ insert Node R ② Create Δdelete & Δinsert Two combined Δ work as one Δupda 1. Use NewTraverse() that returns two <key, val> pairs There is 3 reason for update() to fail 1. NewTraverse() aborted, returning nullptr 2. <key, oldValue> does not exist 3. <key, newValue> already exist 2. Create Δdelete & Δinsert on top of base node without modifying Mapping Table 3. Use CAS operation to modify mapping table If CAS failed: repeat ① ~ ③
  12. 12. PID Ptr L P R S 12 New Update Method Δ Δ delete Node R Δ insert Node R ③ CAS 1. Use NewTraverse() that returns two <key, val> pairs There is 3 reason for update() to fail 1. NewTraverse() aborted, returning nullptr 2. <key, oldValue> does not exist 3. <key, newValue> already exist 2. Create Δdelete & Δinsert on top of base node without modifying Mapping Table 3. Use CAS operation to modify mapping table If CAS failed: repeat ① ~ ③
  13. 13. PID Ptr L P R S 13 New Update Method Δ Δ delete Node R Δ insert Node R ③ CAS Advantage 1. Update operation is atomic only one CAS operation is performed 2. Traverse() is called only once per each CAS operation Reducing redundant tree traversal
  14. 14. 14 New Update Method 362,785,060 127,015,726 835,6980 0 0 0 100000000 200000000 300000000 400000000 1 100 10000 #ofupdatefailure # of update key prev Update() new Update() avg. failure of 5 tests (44threads, total 88000000 updates) New Update() shows no failure what so ever.
  15. 15. Scalable Computing Systems Laboratory Hanyang University Thank You 15

Bw-Tree Update Implementation

Views

Total views

1,526

On Slideshare

0

From embeds

0

Number of embeds

1,407

Actions

Downloads

4

Shares

0

Comments

0

Likes

0

×