Skip to content

Commit

Permalink
Added comments around network resilience
Browse files Browse the repository at this point in the history
  • Loading branch information
finwo committed Aug 6, 2024
1 parent cf5ecc5 commit 98b84d1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions DESIGN
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
palloc defines blobs within a medium

Old blob layout

header
Expand Down Expand Up @@ -36,13 +38,16 @@ During GET of a certain key
Transaction sync idea (part of keveat, not kvsm):

Nodes have predefined connections (--join <ip>:<port> on cli?)
To start, just a tcp connection, newline-delimited messages
We should maintain a lax approach to syncing data, as udp (future) may lose packets
Hint: bittorrent-like request from multiple, packets declare what they are (like, "parents of I are H[]", instead of "response H[]")

Node (A) requests current head list from node (B) (GET /api/v1/transactions/HEAD/parents)
Request for parents of virtual transaction 0/HEAD
(B) responds with parents/heads and their height
Node A requests current head list from node B
Maybe request heads of null for "current" heads?
B responds with current heads with their increments

While received heads contain unknown identifiers:
(A) requests parent list of identifier I (GET /api/v1/transactions/&lt;I&gt;/parents)
(A) requests parent list of identifier I
(B) responds with I's parent identifiers
(A) follows unknown parent path until all parents are known for I
(A) requests contents of I (GET /api/v1/transactions/&lt;I&gt;/contents)
Expand All @@ -62,4 +67,4 @@ Compaction:

Iterate every transaction in storage
Keep transactions with reachable entries
Discard transactions with no reachable entries
Discard transactions with no reachable entries (update surrounding pointers)

0 comments on commit 98b84d1

Please sign in to comment.