Skip to content

Commit

Permalink
update notes
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBear801 committed Mar 4, 2021
1 parent 21552ef commit 346e3c4
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions tech-summary/papers/memcache.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ The problem cache need to fight with is strong consistency.
![#1589F0](resources/pictures/0000FF.png) Races and solutions

```
Race 1:
Race 1: (single cluster)
k not in cache
C1 get(k), misses
C1 v1 = read k from DB
Expand All @@ -228,7 +228,7 @@ Race 1:
```

```
Race 2:
Race 2: (multiple cluster)
during cold cluster warm-up
remember: on miss, clients try get() in warm cluster, copy to cold cluster
k starts with value v1
Expand All @@ -243,9 +243,28 @@ Race 2:
solved with two-second hold-off, just used on cold clusters
after C1 delete(), cold mc ignores set()s for two seconds
by then, delete() will (probably) propagate via DB to warm cluster
see more in 4.3 Cold Cluster Warmup
```

```
Race 3: (Multiple region)
k starts with value v1
C1 is in a secondary region
C1 updates k=v2 in primary DB
C1 delete(k) -- local region
C1 get(k), miss
C1 read local DB -- sees v1, not v2!
later, v2 arrives from primary DB
solved by "remote mark"
C1 delete() marks key "remote"
get() miss yields "remote"
tells C1 to read from *primary* region
"remote" cleared when new data arrives from primary region
see more in the upper image about remote marker
```

***

Expand Down

0 comments on commit 346e3c4

Please sign in to comment.