Repository navigation
Commit 0de9440
Give the desktop peer the two things the phones already had
A peer left running longer than five minutes caught up once on connect and then
received nothing, for ever, while reporting healthy totals. Two causes, both of
them things Ayni has and the peer did not.
THE ADDRESS BOOK WAS NEVER PERSISTED. `AddressBook::builder()` was called
without `.store()`, so p2panda kept it in memory: `node_infos_v1` and
`topics2node_infos_v1` held ZERO rows while the peer reported `pool 4`. Its own
documentation describes that book as how it identifies network partitions "which
can be automatically healed" — a peer syncing with one node and never another is
that sentence. Now persisted to its own SQLite file, separate from the keys
store because p2panda-store uses max_connections(1) and two pools on one file is
a writer-contention bug. 0 -> 4 nodes, 0 -> 12 topic-interest rows.
AND IT NEVER RE-SUBSCRIBED ON A STALL. `Replicator::restream` exists and Ayni
has called it since the phones hit this exact symptom: catch-up delivers on
connect, then `LiveModeStarted` keeps firing while `received_live_operations`
stays 0. The peer now does the same after three stalled passes — three, not one,
because a quiet minute is ordinary when the publisher has nothing to say.
Measured: `holding` flat at 1759 for three passes, `re-subscribed 8 topic(s)`,
then 1762 on the next pass.
Also adds the diagnostics that made this findable: `holding` from the store
rather than `received()` (which counts store events and read 3,400 against 1,729
actually held), the sync event log, and a stall detector.
1 parent cd0e6ee commit 0de9440
2 files changed
Lines changed: 59 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
176 | 210 | | |
177 | 211 | | |
178 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
237 | 242 | | |
238 | 243 | | |
239 | 244 | | |
| |||
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
254 | | - | |
| 259 | + | |
255 | 260 | | |
| 261 | + | |
256 | 262 | | |
257 | 263 | | |
258 | 264 | | |
| |||
265 | 271 | | |
266 | 272 | | |
267 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
268 | 291 | | |
269 | 292 | | |
270 | 293 | | |
| |||
0 commit comments