Repository navigation
feat(cluster): recordings follow the server their storage is on - #284
Merged
Merged
Conversation
Storage.ServerId says which server holds a storage area's files. NULL or
0 is shared storage every server reaches; any other value is local to
that server. zm-api ignored the column everywhere, so on a multi-server
install with per-server storage:
- the retention reaper and the audit ran against storages whose files
this server cannot see. The audit could take every event there for
media-less, and the reaper measured the wrong disk
- event video, frame images and thumbnails failed on the wrong server
- deleting an event there removed the row and left the files
- a media job could be claimed by a server that cannot read the event
Background jobs now leave another server's storage alone, files and rows
both: the reaper, the audit's filesystem pass and its removal of empty
events, the event audit's media check, and the media job worker. The
storage endpoints report no filesystem figures for it.
Requests that read or change an event's files are relayed to the server
that holds them, as monitor requests already are: playback, HLS, frame
images, thumbnails, synopsis, generated videos and DELETE /events/{id}.
Routes that only touch the event's row stay on the server asked. The
caller must be able to see the event's monitor before anything is
relayed.
An export that includes an event on another server's storage carries
its details and a note naming the server, without the media.
Refs #230.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 18, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
Second PR for multi-server installs (#230), after #283.
Storage.ServerIdsays which server holds a storage area's files. NULL or 0 means shared storage that every server reaches. Any other value is local to that server. zm-api ignored the column everywhere, so with per-server storage:What changes
Background jobs leave another server's storage alone, files and rows both.
These skip regardless of
cluster.enabled. A server can't read another's files whatever that setting says.Requests for an event's files are relayed to the server that holds them, through the same relay #283 added for monitors: playback and HLS, video, thumbnail, frame images, synopsis, generated videos, and
DELETE /events/{id}. The caller must be able to see the event's monitor before anything leaves this server.Routes that only read or write the event's row stay on the server asked: event lists and detail,
PATCH, tags, notes, frame rows.Export degrades, it does not fail. An export that includes an event on another server's storage carries that event's details and a
files-unavailable.txtnaming the server, without the media.Worth a reviewer's eye
media_job_store::next_queuedgained askipargument. That is the whole change to the store.forward_to_owner's shared tail moved intorelay_to_server, so the event relay reuses the loop guard, the no-address error and the WebSocket refusal. The monitor relay's messages are unchanged.Limits
/jobslists the queue this server sees.Checked
cargo fmt --all -- --checkandcargo clippy --all-targets --all-features -- -D warningsare cleancargo test --all-features: 1416 passed, 0 failedtests/it_cluster.rs, plus one each init_retention.rs,it_maintenance.rsandit_media_jobs.rs. They cover shared storage (NULL and 0), own storage, a single-server install, a caller who can't see the monitor, a relayed delete, the loop guard, and the reaper and audit leaving another server's storage untouchedopenapi.jsonis unchangedNot checked: a real two-node install with per-server storage. The holodeck lab uses shared storage, so it does not exercise this. Signed-link (
?st=) requests through the new layer are covered by reading, not by a test.Refs #230.
🤖 Generated with Claude Code