Update-log compaction job #40
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#40
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Yjs update logs grow with every edit; compaction bounds storage and load time (ADR 0003/0013).
Scope
Maintenance job (scheduler from #31, hourly): for pages with > N log entries (default 500) and no open collab session, merge log into
ydoc_stateand delete merged rows atomically; skip pages with active sessions (coordination via collab's open-document registry exposed over an internal endpoint or DB flag). Metric log line with pages compacted / bytes saved.Acceptance criteria
page_updatesrows without changing document content (hash comparison test)Technical notes
Dependencies
Depends on #31, #35.
Size: ~1 day
Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add
deanden), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.Done in
acd1cc3(test-typing follow-up3583a04). Bounds Yjs update-log growth (ADR 0013 §compaction).collab_open_sessionstable is the live-session registry: collab marks a page open on document load / closed on unload and refreshes a 30s heartbeat; the compaction job skips pages with a fresh heartbeat. Decoupled from collab (no api↔collab call) and self-healing — a crashed collab's rows age out of the freshness window.CompactionServiceruns hourly via the shared scheduler (#31): for pages with > 500 log rows and no fresh session it mergespage_updatesintoydoc_stateand deletes the merged rows in oneFOR UPDATEtransaction.AC:
Pipeline green (CI+CD, Test+Int). Live on Test: collab healthy,
CompactionModuleinitialized, migration applied on start.