Commit Graph

34 Commits

Author SHA1 Message Date
Raúl Kripalani
4c43736fe9 pstoreds: tighten up gc-based peerstore.
Introduces custom types in protobuf to serde directly into multiaddrs
and peer IDs. Simplify purge by ordering addrs by expiry. In general,
getting this readier for merge.
2018-11-15 13:32:08 +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
1b72b920ed datastore-backed impls of KeyBook and PeerMetadata. 2018-09-28 14:04:52 +01:00
Raúl Kripalani
196ad55260 ds.NewTransaction() can now return an error. 2018-09-27 20:59:57 +01:00
Raúl Kripalani
0f81bdf419 introduce struct for persisted value. 2018-09-18 19:01:24 +01:00
Raúl Kripalani
5b9ad98cc2 remove noop Stop() in address book. 2018-09-18 19:00:07 +01:00
Raúl Kripalani
4b2c1212e7 add a test and fix broken logic. 2018-09-14 18:27:23 +01:00
Raúl Kripalani
3a4d8096cf remove unnecessary return values. 2018-09-14 17:35:49 +01:00
Raúl Kripalani
b75ed37f2b reintroduce import prefixes. 2018-09-13 16:10:14 +01:00
Raúl Kripalani
23be462e82 Merge branch 'txndatastore' into ttldatastore 2018-09-13 16:02:09 +01:00
Raúl Kripalani
7e645fa115 do not prettify cache keys (peer ids). 2018-09-13 15:33:30 +01:00
Raúl Kripalani
afc9ee92b0 performance optimisation round. 2018-09-13 15:33:30 +01:00
Raúl Kripalani
9277207b35 remove deprecated ttlManager. 2018-09-13 12:49:03 +01:00
Raúl Kripalani
80fc9f03ca migrate from bespoke TTL manager to db-managed TTLs. 2018-09-13 12:21:30 +01:00
Raúl Kripalani
c7d99489fd address review comments. 2018-09-12 13:53:10 +01:00
Raúl Kripalani
4037390c42 increase test coverage. 2018-09-11 18:17:27 +01:00
Raúl Kripalani
7ae2621803 small fixes. 2018-09-11 14:42:19 +01:00
Raúl Kripalani
eb2575505d fix bug in PeersWithAddrs(). 2018-09-11 14:14:56 +01:00
Raúl Kripalani
1b410c7294 Merge branch 'master' into txndatastore 2018-09-11 14:13:14 +01:00
Raúl Kripalani
903aa12603 check cache in ClearAddrs and perform targeted delete. 2018-09-11 12:43:36 +01:00
Raúl Kripalani
03ee26fd4f change cache layout, now peer.ID => []ma.Multiaddr. 2018-09-11 11:48:23 +01:00
Raúl Kripalani
1c25f160a1 normalise import aliases. 2018-09-07 18:46:23 +01:00
Raúl Kripalani
2901497643 migrate Addrs() and PeersWithAddrs() to use txns, improve perf, benchmarks. 2018-09-07 18:37:01 +01:00
Raúl Kripalani
171f051aa1 add tests for keybook; []peer.ID => peer.IDSlice. 2018-09-07 13:04:14 +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
7d8b6c9843 ttl manager: create transaction only when needed.
Also adjust test logic. Last changes were ticking the ttl manager
too often unnecessarily. This was skewing benchmarks.
2018-09-04 14:52:26 +01:00
Raúl Kripalani
de573ac1ff migrate TTL manager to ds.TxnDatastore. 2018-09-07 17:45:29 +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
2f98672d1d rename *Peers() to PeersWith*(). 2018-09-02 12:18:00 +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