Commit Graph

16 Commits

Author SHA1 Message Date
Raúl Kripalani
c3c24b227a rename GCPruneInterval to GCPurgeInterval for consistency. 2018-11-28 01:29:09 +00:00
Raúl Kripalani
35444fbc6a implement two-tiered lookahead-based GC procedure.
The GC procedure consists of two tiers: lookahead and purge. The
lookahead tier runs less frequently (default 12 hours) than the purge
tier (default 5 minutes).

A lookahead round traverses the entire store and picks entries that
need to be visited in the current lookahead window, pinning those
entries in a separate region in the KV store, indexed by the next visit
timestamp.

A purge round iterates over the lookahead window only, and refreshes
the entries that require a visit. It removes them from the lookahead
region unless the entry requires another visit within the current
window.
2018-11-28 00:13:02 +00:00
Raúl Kripalani
c423e9e997 pstoreds: migrate from strict TTL to GC-based expiry.
Each entry in the address book KV store now represents a full peer
with all its addresses. Expiries and TTLs are kept inline. Records are
serialised with Protobuf.

Housekeeping is performed on retrieve, and via a periodic GC routine.
The architecture mimics a write-through cache, although not strictly.
2018-11-13 16:57:51 +00:00
Raúl Kripalani
4e2e2de65f ds key encoding: b58 => b32 (no padding). 2018-10-04 10:51:57 +01:00
Raúl Kripalani
3e80eb1873 review comments. 2018-09-28 18:47:41 +01:00
Raúl Kripalani
dd3cb20421 add explicit import aliases. 2018-09-28 14:18:05 +01:00
Raúl Kripalani
1b72b920ed datastore-backed impls of KeyBook and PeerMetadata. 2018-09-28 14:04:52 +01:00
Raúl Kripalani
c7d99489fd address review comments. 2018-09-12 13:53:10 +01:00
Raúl Kripalani
1b410c7294 Merge branch 'master' into txndatastore 2018-09-11 14:13:14 +01:00
Raúl Kripalani
1c25f160a1 normalise import aliases. 2018-09-07 18:46:23 +01:00
Raúl Kripalani
d79386365e rename NewPeerstoreWith(...) => NewPeerstore(...); adjust godoc. 2018-09-05 15:14:57 +01:00
Raúl Kripalani
7f4288fab1 rename package mem => pstoremem. 2018-09-04 18:07:44 +01:00
Raúl Kripalani
1b57c62e3d increase benchmark coverage; introduce config struct.
* benchmark caching and cacheless variants of DS addrbook.
* benchmark peers with 1, 10, 100 addrs.
2018-09-07 17:45:29 +01:00
Raúl Kripalani
f8aeb5476e another perf improvement iteration. 2018-09-07 17:45:25 +01:00
Raúl Kripalani
e200f3a5c1 gx-go unrewrite. 2018-09-02 12:10:55 +01:00
Raúl Kripalani
d0c3d2b341 rename ds package to pstoreds. 2018-09-02 12:03:02 +01:00