Repository navigation
state: replicate deletes, so a client's tree mirrors the relay's - #1473
Merged
Merged
Conversation
A node removed from a replicated tree stayed on every peer: - state_sync_adapter journaled values, data and metadata, but not removals; - a WS relay's broadcast diff forgot paths that left its tree without telling the client; - a joiner's snapshot only says what is there. So a world's departed vehicles and spawn points, the entries a server document's (state-set-tree) drops, and DSL list rows stayed on clients. Removals are journaled (state_sync_adapter): - A removal goes out as one delete_subtree at the removed node. Its childChanged fires on every observed ancestor; the first slot drops the subtree's observers, and only that slot journals. - The delete is timed by the shard's clock (set_clock). A remote delete is applied, not echoed. Tombstones and burial (state_sync_adapter, state_cluster_shard): - Each timed delete applied leaves a tombstone: its path and time, for 10 min, at most 4096. - ingest_remote buries a remote write at or below a tombstone whose time is no later than the delete's: its writer made it before it saw the delete. It is recorded as seen, not applied, and reported as ingest_result::buried. Relays do not forward it. Delivery and repair: - state_peer_registry::should_deliver(node, path, subtree) delivers a delete above a peer's subscription. The WS, gRPC, inproc and IPC fan-outs and backfills use it. - A WS relay's broadcast_snapshot sends a delete (state_transport::tree_removal: origin <shard>#sync, untimed) for each subtree a client was sent that has left the tree. - A relay that does not backfill (arisrv's S7 default) repeats its tombstones after a joiner's admit snapshot, skipping subtrees that came back (state_transport::missed_deletes). room_write_gate lets a participant delete inside its own subtree. It may not delete the participant node itself, nor a node that would take a relay-owned key with it. Docs: ARIADNE.md's state-set-tree and fleet notes; DISTRIBUTED_STATE_ROADMAP.md's known gaps.
transfix
enabled auto-merge (squash)
November 23, 2026 03:35
transfix
added a commit
that referenced
this pull request
Nov 23, 2026
… into p9/volume-grid-segment INDEX.ari keeps both new entries (volume_grid_segmentation, http_cache). volume_grid_contours.png conflicted (#1450 re-rendered it for rows that flow); kept ours until CI renders the merged panel.
transfix
added a commit
that referenced
this pull request
Nov 24, 2026
…grace A participant who left stayed in the room tree for good. The relay only marked it left (presence.joined=0), since a delete did not replicate before #1473. So every client held, and every join snapshot carried, a ghost of everyone who had ever joined. The relay (arisrv) now removes them: - When a connection ends, the participant is marked left at once, as before: the roster, the holon and the area of interest drop it. - Once it has been away --leave-grace-s (default 300) without coming back, room_departures removes its subtree (room_remove): one delete, which every client applies. - One back in time, joined again or holding a connection, is kept. A client that reconnects (it keeps its pid) finds what it published, its streams, avatar and device, still there. - --leave-grace-s 0 removes it as its connection ends. A bridged user leaves with a delete at once (room_bridge_absent). The relay is their only writer, and one who comes back is written anew. room_leave still only marks a participant left: a client's (room-leave) and a document's teardown do that, and the relay removes it once its connection has gone. Docs: the conference roadmap's switch table, reaping note and room-leave row; DISTRIBUTED_STATE_ROADMAP.md's known gaps.
transfix
added a commit
that referenced
this pull request
Nov 24, 2026
…in, silent links, scene removals (#1483) A participant who left stayed in the room tree for good: the relay only marked it left (presence.joined=0), since a delete did not replicate before #1473. So every client held, and every join snapshot carried, a ghost of everyone who had ever joined. The relay (arisrv) now removes departed participants: - When a connection ends, the participant is marked left at once, as before: the roster, the holon and the area of interest drop it. - Once it has been away the grace without joining again, room_departures removes its subtree (room_remove): one delete, which every client applies. One whose connection is back has the whole grace from then to join; one marked left that keeps its connection (a document's (room-leave)) is removed after the grace too. - The grace is per room: the server document's server: leave_grace_s:, which --leave-grace-s overrides; 300 when neither says; 0 removes it as its connection ends. Back after the grace: room_own_state keeps what a participant published under its node (not the relay's keys, its presence, intent, net readings or drive request), and room_reassert writes it again. arigl takes it before it redials and writes it while it rejoins; a document's (room-join) does it after its own (room-leave). The relay forgets the streams it relayed for a removed participant, so one published again is relayed and marked ready afresh. Silent connections: state_transport::reap_idle, now on the gRPC transport too. arisrv reaps both transports each second after --idle-timeout-s (default 10; 0 = never), and arigl and relay_session close a silent link to the relay, so they dial again. A bridged user leaves with a delete at once (room_bridge_absent). Scene objects, lights and avatar options the relay drops are removed (a delete each), not marked present = 0. Docs: ARIADNE.md's server: block, the conference roadmap's switches and reaping note, and DISTRIBUTED_STATE_ROADMAP.md's known gaps.
transfix
added a commit
that referenced
this pull request
Nov 24, 2026
… = 0 (#1525) write_room_entities marked an entity the world no longer has present = 0, so the room tree, and every client's copy and join snapshot, kept a subtree for every entity that ever ran. Deletes replicate since #1473, and the room's scene objects, lights and avatar options are removed that way since #1483; entities now are too. - section_writer::remove takes an entry (a leaf or a subtree) out of a revisioned section: one delete, which every peer applies, and whose tombstone keeps a peer that still holds the entry from bringing it back. Never the section itself. - write_room_entities removes each entity the section has that the world does not, before the commit that bumps the revision, so a reader that sees the new revision no longer finds it. Readers still take only entries with present = 1, which a write sets last. Docs: room_entities.h, the conference roadmap's reaping note, ARIADNE_WORLDS.md's scene wire format and old-relay note.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Until now, a node removed on a replicated tree stayed on every peer.
state_sync_adapterjournaled values, data and metadata, but not removals. A WS relay's periodic diff dropped paths that left its tree without telling the client. A joiner's snapshot only says what is there. The only delete that ever reached a client was a read-scope retraction.So every server-side removal left ghosts on clients:
(state-set-tree)drops (the way ARIADNE.md tells server documents to take entries out);(state-delete).What changes
Removals are journaled (
state_sync_adapter)delete_subtreeat the removed node.childChangedfires on every observed ancestor, and only the first finds the node still observed.set_clock, wired bystate_cluster_shard).Tombstones stop resurrection (
state_sync_adapter,state_cluster_shard)ingest_remoteburies a remote write at or below a tombstone whose time is no later than the delete's. Its writer made it before it saw the delete. The write is recorded as seen, not applied, and reported asingest_result::buried; neither relay transport forwards it.Deletes reach subscribers below them (
state_peer_registry)amust reach a peer subscribed toa.b, or one whose filter delivers something belowa.should_deliver(node, path, subtree)anddelivery_view::deliver(path, subtree)handle that case.read_scope_delivers.Missed deletes are repaired (
state_transport_ws,state_transport_grpc)broadcast_snapshotsends a delete for each subtree a client was sent that has since left the tree, so a client that missed the live delete converges within one broadcast. Paths that only left the client's view are forgotten, as before. These deletes come from<shard>#syncand are untimed, so they leave the client no tombstone (state_transport::tree_removal).state_transport::missed_deletes). A client back from a dropped link loses what went while it was away. A relay that does backfill already replays the deletes with the rest of its journal.The room gate admits own deletes (
room_write_gate)profile,net,streams,streams.<kind>,pose, and so on.Not done
state::reset(false)drops children without signalling, so it still replicates nothing (only tests call it).presence.joined=0). Switching it to real deletes is a separate change.Tests
state_sync_adapter_test:state_transport_inproc_test:state_transport_ws_test:state_transport_grpc_test: live delete, and the admit repeat.room_intrinsics_test: the gate's delete rules.