56
1 Dalí: A Periodically Persistent Hash Map Faisal Nawab* 1 , Joseph Izraelevitz* 2 , Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*, and Michael L. Scott 2 The 31 st Annual International Symposium on Distributed Computing (DISC) October 17-19, 2017 Vienna, Austria 1 Department of Computer Science University of California, Santa Barbara [email protected] 2 Department of Computer Science University of Rochester {jhi1,scott}@cs.rochester.edu *Work done while at HPE Labs

Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

1

Dalí: A Periodically Persistent Hash Map

Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*, and Michael L. Scott2

The 31st Annual International Symposium on Distributed Computing (DISC)

October 17-19, 2017 Vienna, Austria

1Department of Computer Science

University of California, Santa Barbara

[email protected]

2Department of Computer Science

University of Rochester

{jhi1,scott}@cs.rochester.edu

*Work done while at HPE Labs

Page 2: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

2

Motivation• Persistent non-volatile main

memory (NVM) is coming• Byte addressable

• Access times comparable to DRAM

• Survives power outages

• Opportunity for fast durable storage

Main Memory

Disk

Caches

CPUTransient

Persistent

Page 3: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

3

Motivation• Persistent non-volatile main

memory (NVM) is coming• Byte addressable

• Access times comparable to DRAM

• Survives power outages

• Opportunity for fast durable storage

• But caches and registers are expected to remain transient!

Main Memory

Disk

Caches

CPUTransient

Persistent

Page 4: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

4

A practical concern• How to ensure a meaningful

persistent state in the wake of a crash?

Main Memory

Disk

Caches

CPUTransient

Persistent

Page 5: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

5

Ordering persistent writes

•Writes to persistence must be ordered by the programmer, otherwise consistency can be violated.

data=42

ptr

Page 6: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

6

Ordering persistent writes

•Writes to persistence must be ordered by the programmer, otherwise consistency can be violated.

data=42

ptr

first make node persistent

Page 7: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

7

Ordering persistent writes

•Writes to persistence must be ordered by the programmer, otherwise consistency can be violated.

data=42

ptr

then the pointer

Page 8: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

8

Ordering persistent writes

•Writes to persistence must be ordered by the programmer, otherwise consistency can be violated.

data=42

ptr

INCORRECT

Page 9: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

9

Ordering persistent writes

•Writes to persistence must be ordered by the programmer, otherwise consistency can be violated.

•Because caches can leak, we need to persist the node before writing the pointer.

data=42

ptr

INCORRECT

Page 10: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

10

Ordering persistent writes

•Writes to persistence must be ordered by the programmer, otherwise consistency can be violated.

•We call this philosophy Incremental Persistence

data=42

ptr

INCORRECT

Page 11: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

11

Incremental Persistence

•Current ISA support is limited• CLFLUSH – write cache line to persistence• MFENCE – ensure prior flushes are persisted

data.st(42)

clflush(&data)

mfence()

ptr.st(&data)

clflush(&ptr)

data=42

ptr

1

21

2

Page 12: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

12

Incremental Persistence

•Current ISA support is limited• CLFLUSH – write cache line to persistence• MFENCE – ensure prior flushes are persisted

data.st(42)

clflush(&data)

mfence()

ptr.st(&data)

clflush(&ptr)

Enforce ordering, require round trip

latency to main memory

data=42

ptr

1

2

Page 13: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

13

The Problem

• Incremental persistence is slow• Multiple high latency ordering fences per operation

•Our work: How can we reduce this overhead?

Page 14: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

14

Our Idea: Periodic Persistence

•A new design philosophy in contrast to incremental persistence.

• Instead of “flushing as you go,” periodically ensure all cached data becomes persistent.

•The recovery procedure avoids any stores which may not be persistent.

Page 15: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

15

Contributions

•Present periodic persistence as an alternate design philosophy for durable data structures.

• Implement Dalí, a periodically persistent hash map.

•Prove Dalí correct under buffered durable linearizability*.

•Demonstrate our Dalí prototype improves on state-of-the-art performance.

*Izraelevitz, Mendes, Scott, DISC ‘16

Page 16: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

16

Our Idea: Periodic Persistence

•A new design philosophy in contrast to incremental persistence.

• Instead of “flushing as you go,” periodically ensure all cached data becomes persistent.

•The recovery procedure avoids any stores which may not be persistent.

Page 17: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

17

Periodic Persistence

head

Page 18: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

18

Periodic Persistence

List becomes

persistent using a

global fence to persist

cached data.

head

Page 19: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

19

Periodic Persistence

Append nodes to the list, modifying head

head

Page 20: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

20

Periodic Persistence

head

Page 21: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

21

Periodic Persistence

Recovery procedure

choses the most

recent list that is

guaranteed to be

persistent (might

lose some recent operations)

head

Page 22: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

22

Infrastructure•Global fence pushes updates into persistence

• If a global fence begins and ends between a store and a crash, the store will be persistent.

store

global fence

Page 23: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

23

Infrastructure•Global fence pushes updates into persistence

• If a global fence begins and ends between a store and a crash, the store will be persistent.• We use a whole cache flush as the global fence.

store

global fence

Page 24: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

24

Infrastructure•Global fence pushes updates into persistence

• If a global fence begins and ends between a store and a crash, the store will be persistent.• We use a whole cache flush as the global fence.

1

store

global fence

epoch

Page 25: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

25

Infrastructure•Global fence pushes updates into persistence

• If a global fence begins and ends between a store and a crash, the store will be persistent.• We use a whole cache flush as the global fence.

1

store

global fence

epoch 2

All epoch 1 stores are

persistent after epoch 2.

Page 26: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

26

Infrastructure•Global fence pushes updates into persistence

• If a global fence begins and ends between a store and a crash, the store will be persistent.• We use a whole cache flush as the global fence.

1

store

global fence

epoch 2 3 4

Page 27: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

27

Infrastructure•Global fence pushes updates into persistence

• If a global fence begins and ends between a store and a crash, the store will be persistent.• We use a whole cache flush as the global fence.

1

store

global fence

epoch 2 3 4

Page 28: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

28

Infrastructure•Global fence pushes updates into persistence

• If a global fence begins and ends between a store and a crash, the store will be persistent.• We use a whole cache flush as the global fence.

1

store

global fence

epoch 2 3 4

Failure in epoch 4

means stores in

epochs 3,4 are not

guaranteed persistent

(the epochs “failed”)

Page 29: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

29

Infrastructure•Global fence pushes updates into persistence

• If a global fence begins and ends between a store and a crash, the store will be persistent.• We use a whole cache flush as the global fence.

1

store

global fence

epoch 2 3 4

Page 30: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

30

Infrastructure•Global fence pushes updates into persistence

• If a global fence begins and ends between a store and a crash, the store will be persistent.• We use a whole cache flush as the global fence.

1

store

global fence

epoch 2 3 4 5

Page 31: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

31

Periodic Persistence

head

Global fence divides

list sections, epoch

number determines which list to use

Page 32: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

32

Dalí

•Periodically persistent hash map

•Provably correct under buffered durable linearizability

Page 33: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

33

Dalí

• Each bucket is an append only list• All updates add new node with key and new value• Deletes store a tombstone• Gets find most recent node that matches the key• Infrequently reclaim outdated key values• Lock the bucket for updates and reads

• How do we maintain the head?

head

Page 34: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

34

Dalí Bucket Metadata

ptr0

ptr1

ptr2

Page 35: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

35

Dalí Bucket Metadata in Epoch 3

ptr0

ptr1

ptr2

Committed (1)

In-Flight (2)

Active (3)

As of

epoch 3,

State word: single 64-bit word

Page 36: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

36

Now in Epoch 4, after a global fence

ptr0

ptr1

ptr2

State word: single 64-bit word

Committed (1)

In-Flight (2)

Active (3)

As of

epoch 3,

Page 37: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

37

Dalí Update in Epoch 4

ptr0

ptr1

ptr2

State word: single 64-bit word

Committed (1)

In-Flight (2)

Active (3)

As of

epoch 3,

1

Page 38: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

38

Dalí Update in Epoch 4

ptr0

ptr1

ptr2

1

2

Active (4)

Committed (2)

In-Flight (3)

As of

epoch 4,

State word: single 64-bit word

Page 39: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

39

Dalí Update in Epoch 4

ptr0

ptr1

ptr2

1

2

Active (4)

Committed (2)

In-Flight (3)

As of

epoch 4,

*We ensure both updates occur in the

same epoch.

An update changes state word

and adds the new node*.

State word: single 64-bit word

Page 40: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

40

Dalí After a Crash in Epoch 4

ptr0

ptr1

ptr2

Active (4)

Committed (2)

In-Flight (3)

As of

epoch 4,

Page 41: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

41

Dalí After a Crash in Epoch 4

ptr0

ptr1

ptr2

Active (4)

Committed (2)

In-Flight (3)

As of

epoch 4,

Committed (1)

In-Flight (2)

Active (3)

As of

epoch 3,

Page 42: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

42

Dalí After a Crash in Epoch 4

ptr0

ptr1

ptr2

Active (4)

Committed (2)

In-Flight (3)

As of

epoch 4,

In-Flight (1)

Active (2)

Committed (0)

As of

epoch 2,

Page 43: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

43

Dalí After a Crash in Epoch 4

ptr0

ptr1

ptr2

Active (4)

Committed (2)

In-Flight (3)

As of

epoch 4,

All state words will result in

the correct dereference of

the persistent suffix!

In-Flight (1)

Active (2)

Committed (0)

As of

epoch 2,

Page 44: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

44

Dalí Rotations

•State word rotations for updates depend on • Presence/absence of recent crashes• Prior pointer assignments

•Details in the paper

Page 45: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

45

Dalí Correctness

•Dalí is correct under buffered durable linearizability*.

*Izraelevitz, Mendes, Scott, DISC ‘16

Page 46: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

46

Buffered Durable Linearizability*

•Data structure is linearizable in the absence of crashes•After a crash, some operations may be lost, but no lost

operation will have happened-before a preserved one.• The data structure’s state matches a consistent-cut across the

happens-before order.

• For Dalí, this consistent cut is the end of the most recent successful epoch before the crash.• If the crash occurs in epoch F, the cut is consistent with the end

of epoch F-2.• Proof of correctness in the paper.

*Izraelevitz, Mendes, Scott, DISC ‘16

Page 47: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

47

Performance

•4 x Intel Xeon E7-4890 v2 processors, each with 15 cores (60 hardware threads w/o hyperthreading).

•Keys are 8 bytes in length, and are drawn randomly from a uniform distribution of 100 million values. Values are 1000 bytes in length.

•We initialize the map with all keys in the key range, transactions consist of 3 gets/1 update.

Page 48: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

48

Prototype Performance

*

*Kimura, SIGMOD ’16 †Tu et al., SOSP’13

Page 49: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

49

Future Work

•Generalizing periodic persistence• Applications to STM, other data structures

•Hardware support for global fences

Page 50: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

50

Conclusion

•Present periodic persistence as an alternate design philosophy for durable data structures.

• Implement Dalí, a periodically persistent hash map.

•Prove Dalí correct under buffered durable linearizability.

•Demonstrate our Dalí prototype improves on state-of-the-art performance.

Page 51: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

51

Backup Slides

Page 52: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

52

Dalí Rotations

•State word rotations for updates depend on • Presence/absence of recent crashes• Prior pointer assignments

•They follow 3 rules• [C] The new committed pointer was written at least 2

epochs prior.• [F] The new in-flight pointer is the most recent node

added in the previous epoch, or invalid otherwise.• [A] The new active pointer was last written before the

new committed pointer, or was invalid.

Page 53: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

53

Proof Sketch

•After a crash, some suffix of the list is contiguous and persistent, • Call the head v.• At some point in time, a bucket pointer pointed to this suffix.

Call this pointer ptrv

• By [A], ptrv will still point to v after a crash, since it has not yet been superseded by a more recent committed pointer.

• The state word after the crash will assign ptrv’s to one of three roles. • In all cases, a reader seeing the associated state word will use v

as the head.

Page 54: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

54

Dalí Details

•Transactions: by ensuring all updates occur in a single epoch, we can guarantee they all become persistent at the same time.

•Garbage Collection / Compression: we remove shadowed nodes and consolidate existing values into big nodes. These are then linked into the list after the next periodic fence.

•Optimization: updates to the same key in the active epoch can overwrite the current node.

Page 55: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

55

Dalí Bucket Metadata

ptr0

ptr1

ptr2

ptr0

ptr1

ptr2

Update

Page 56: Dalí: A Periodically Persistent Hash Map1 Dalí: A Periodically Persistent Hash Map Faisal Nawab*1, Joseph Izraelevitz*2, Terence Kelly*, Charles B. Morrey III*, Dhruva R. Chakrabarti*,

56

Dalí Bucket Metadata

ptr0

ptr1

ptr2

Crash

ptr0

ptr1

ptr2