Skip to content

Document-level worker quarantine (pause compaction for a room) in addition to stream quarantine #69

Description

@bgeils

Summary

v0.2.18's stream quarantine (stream.quarantine, unquarantine, …) is the right primitive for "move this bad batch of updates aside" — we use it heavily. But operationally we also need the other control: stop workers from compacting this room until an operator resumes it, while the room stays writable for clients.

Without it, the failure loop we hit in production is:

  1. A room repeatedly fails compaction (whatever the cause).
  2. We quarantine the current stream — necessary, but not sufficient.
  3. Clients keep writing; the live stream refills.
  4. Workers pick the room up again, hit the same condition, fail again.
  5. Repeat — the worker queue fills with auto-quarantined error tasks for the same room.

We built this downstream as a Redis marker ({prefix}:document_quarantine:{org}:{docid}:{branch} + an index set) that our worker consults before compacting, our admin API reports, and our recovery runbook drives. It works, but it is glue around y/hub internals and has to be re-validated on every upgrade.

Ask

A room-level worker-pause primitive, e.g.:

await yhub.quarantineRoomForWorkers(room, { reason, details })
await yhub.isRoomQuarantinedForWorkers(room)
await yhub.unquarantineRoomForWorkers(room)

Expected behavior: websocket and REST writes unaffected; worker compact tasks for the room acked/skipped without processing; explicit operator-driven resume; composes with (does not replace) stream quarantine. Related detail from our incident history: repeated auto-quarantines leave one nop-marker quarantine stream behind per attempt — 120 of them on one document — so a backlog inspection that counts raw XLEN reports phantom pending messages forever; a first-class primitive could also own "empty quarantine stream" hygiene.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions