You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a <prefix>/buffers/<sid>/<key> scope: a session-scoped, disk-backed,
pull+push large-value store. One put fans the full payload out to live
subscribers and stores identical bytes for later get. Persistence is per-session
(kDurable / kEphemeral).
key.hpp: add KeyKind::Buffer; BuildBufferKey(sid, key); ParseKey
branch for buffers/<sid>/<key>; validation reuses existing <sid>/<key>
grammar. No $batch, no snap counterpart.
Config / SessionOptions: BufferPersistence { kDurable, kEphemeral }; SessionOptions{buffers} per session; Config global default (kDurable).
SessionController: on CreateSession, for kDurable create a per-session
disk StorageEngine for buffers; on CloseSession, purge/close it (subsequent
get returns not-found).
StorageNode: routing branch for buffers/**:
put → for kDurable, write bytes to the session buffer engine; zenoh fans
the same bytes to live subscribers. For kEphemeral, no store.
get/List → for kDurable, respond from the session buffer engine; for kEphemeral, respond empty/not-found.
delete → remove from the session buffer engine.
Late-join: document and test the querying-subscriber ordering
(get buffers/<sid>/**, then subscribe), mirroring ParamCache::Attach.
Docs: apply the patches in doc-patches.md to docs/02 §2 and docs/03 §1.
Acceptance criteria (AC)
AC1: BuildBufferKey / ParseKey round-trip for valid keys; invalid <sid>
or <key> rejected; buffers/** never parses as Base/Session/Snapshot.
AC2: A put to buffers/<sid>/<key> in a kDurable session is (a) delivered
in full to a pre-existing subscriber and (b) returned identically by a later
get. Byte-for-byte equality asserted.
AC3: A late-joining querying subscriber receives all values put before it
attached, with no lost updates under concurrent puts.
AC4: In a kEphemeral session, live subscribers receive the payload but get
returns not-found and nothing is written to disk.
AC5: After CloseSession, get on any buffers/<sid>/** key returns
not-found; the per-session engine's storage is released.
AC6: ParamCache subscribed to session/<sid>/** does not receive any buffers/<sid>/** payloads (scope isolation test).
AC7: A raw zenoh client can put and get a buffer following docs/03 §1
(interop test), consistent with existing RawZenohClient* tests.
Dependencies
Depends on: StorageEngine abstraction (done), StorageNode, SessionController
(v0.2), and a disk engine for kDurable = RocksDBEngine (v0.4, [M1] RocksDBEngine #8).
Not required: snapshots, batch, ack.
Out of scope (follow-ups)
Shared-memory zero-copy for same-host transfers.
Per-subscriber reliability tuning and backpressure policy.
HTTP GET access (covered by the gateway issue / ADR-0015).
Summary
Add a
<prefix>/buffers/<sid>/<key>scope: a session-scoped, disk-backed,pull+push large-value store. One
putfans the full payload out to livesubscribers and stores identical bytes for later get. Persistence is per-session
(
kDurable/kEphemeral).References
docs/02_architecture.md§2 (key space), §4 (StorageNode)docs/03_wire_protocol.md§1 (key space)Scope
KeyKind::Buffer;BuildBufferKey(sid, key);ParseKeybranch for
buffers/<sid>/<key>; validation reuses existing<sid>/<key>grammar. No
$batch, nosnapcounterpart.BufferPersistence { kDurable, kEphemeral };SessionOptions{buffers}per session;Configglobal default (kDurable).CreateSession, forkDurablecreate a per-sessiondisk StorageEngine for buffers; on
CloseSession, purge/close it (subsequentget returns not-found).
buffers/**:kDurable, write bytes to the session buffer engine; zenoh fansthe same bytes to live subscribers. For
kEphemeral, no store.kDurable, respond from the session buffer engine; forkEphemeral, respond empty/not-found.(get
buffers/<sid>/**, then subscribe), mirroringParamCache::Attach.doc-patches.mdtodocs/02§2 anddocs/03§1.Acceptance criteria (AC)
BuildBufferKey/ParseKeyround-trip for valid keys; invalid<sid>or
<key>rejected;buffers/**never parses asBase/Session/Snapshot.puttobuffers/<sid>/<key>in akDurablesession is (a) deliveredin full to a pre-existing subscriber and (b) returned identically by a later
get. Byte-for-byte equality asserted.
attached, with no lost updates under concurrent puts.
kEphemeralsession, live subscribers receive the payload but getreturns not-found and nothing is written to disk.
CloseSession, get on anybuffers/<sid>/**key returnsnot-found; the per-session engine's storage is released.
session/<sid>/**does not receive anybuffers/<sid>/**payloads (scope isolation test).docs/03§1(interop test), consistent with existing
RawZenohClient*tests.Dependencies
(v0.2), and a disk engine for
kDurable= RocksDBEngine (v0.4, [M1] RocksDBEngine #8).Out of scope (follow-ups)