summaryrefslogtreecommitdiffstats
path: root/src/swarm/sync.rs
Commit message (Collapse)AuthorAgeFilesLines
* cache headstv17 hours1-2/+3
| | | | To reduce the number of write locks, heads are now cached.
* being caught up needs some headstv18 hours1-5/+9
| | | | | | | | | | | A sync message from a ready peer only completes the initial sync if that peer has at least one head. A peer with an empty document can no longer make a joiner ready on an empty store: a misconfigured second swarm, or a genesis node in its first seconds. Effect on a brand-new swarm: a joiner now waits until the genesis node has registered itself in the member list, which happens within about 5 s of it becoming ready.
* add chunked download and use it during rejointv22 hours1-0/+6
|
* add throughput statstv31 hours1-1/+18
|
* add propagation statstv31 hours1-0/+15
|
* add swarm statstv32 hours1-1/+7
|
* pull missing changestv33 hours1-5/+14
| | | | | | Nodes push changes to their neighbours but don't relay them directly. In a partial mesh, nodes can learn about missing changes via keepalive messages and can pull them from their neighbours.
* sync with neighbourstv34 hours1-1/+13
|
* retry using fresh messagestv35 hours1-158/+127
| | | | | Don't store encoded messages but retry using a newly generated one. That way any accumulated changes can be delivered at once.
* drop stall breaker; resend needed changestv38 hours1-65/+21
| | | | | | The stall breaker was superseded by regular re-handshaking Re-handshaking also gets triggered, when a node needs some of the heads its peer believes it has already sent. In that case the peer now resends what's needed.
* both sides may open sync after resettv39 hours1-19/+8
| | | | | | | | | | Ready nodes will leave the first message to the pear that isn't ready. Hello and hello reply now carry ready, so readiness is known from the very first contact, before any sync. Together with the sync messages and keepalives, reports_ready is always current. After epoch switch, pings go to everyone except ready members already on the new epoch, these learn from the lagging peer's opening.
* perform handshake in one round triptv39 hours1-1/+0
|
* drop pre-membership sync messagestv39 hours1-16/+4
| | | | | The handshake resets the session anyway, and the sender's reply timeout resends what still matters.
* probe sync source during catch-uptv40 hours1-105/+6
| | | | This allows changing sources without the fixed 30 s stall duration.
* use only ready peers as sync sourcetv40 hours1-11/+52
| | | | | | Sync messages now carries a ready flag, telling whether the sending peer itself is joined or is itself still (re-)joining. In the latter case, the peer won't be used as sync source.
* catch up with a single source onlytv41 hours1-1/+86
|
* record the cause that started a sync sessiontv41 hours1-1/+10
|
* merge sync_reset_at and epoch_unannounced into openingtv41 hours1-6/+1
|
* introduce sync sessiontv42 hours1-26/+32
| | | | SyncSession holds all fields that get reset by reset_sync()
* merge membership and authenticate into standingtv43 hours1-6/+6
|
* announce epochs by sync instead of pingtv43 hours1-0/+4
|
* pick pair leader by hash instead of key ordertv2 days1-1/+1
|
* open sync only from one sidetv2 days1-3/+21
| | | | | | | | | If both sides open, the openings cross, and an empty node's answer to the other opening (empty heads) makes the other side send the whole document a second time. Now after a sync reset, only the side with the smaller public key opens the sync; the other answers it, or opens itself if nothing arrives.
* don't resend sync messages to up-to-date peerstv3 days1-3/+13
| | | | | | | | | | | When an sync messages arrives and automerge has nothing to say about it, then no reply is generated. With c9279e4 it was assumed that every sync message gets an answer, so missing replies caused unnecessary resends. Now a reply is only awaited if the peer's last reported heads differ from ours. If the peer's heads become equal through a third peer without replying, the waiting will also abort if a ping or pong showss the same heads digest on both sides.
* rename cluster to swarm everywhere!tv4 days1-21/+21
|
* resend sync messages that haven't been repliedtv4 days1-4/+13
|
* reorganize all the modulestv4 days1-0/+564