Skip to content

Queue splitting design plan - #4276

Closed
thallgren wants to merge 6 commits into
release/v2from
thallgren/queue-splitting
Closed

Queue splitting design plan#4276
thallgren wants to merge 6 commits into
release/v2from
thallgren/queue-splitting

Conversation

@thallgren

Copy link
Copy Markdown
Member

Design plan for queue splitting: personal, header-filtered intercepts of message-queue consumption. A manager-owned queue-agent takes over a declared source and routes messages into per-developer and application shadow queues, with Kafka and RabbitMQ as co-equal v1 backends behind a provider-neutral engine contract.

This PR contains only the plan (docs/plans/queue-splitting/plan.md) for design review; no implementation. Implementation is gated on the phase-0 real-broker feasibility prototypes described in the plan's delivery section.

Base automatically changed from thallgren/client-rbac-minimization to release/v2 August 17, 2026 19:02
A design for personal, header-filtered intercepts of message-queue
consumption: a manager-owned queue-agent takes over a declared Kafka
topic or RabbitMQ queue and routes messages into per-developer and
application shadow queues. Kafka and RabbitMQ are co-equal v1 backends
behind a provider-neutral engine contract; implementation is gated on
real-broker feasibility prototypes (phase 0).

Signed-off-by: Thomas Hallgren <thomas@tada.se>
Both provider gates passed against real brokers (Kafka 4.3.1,
RabbitMQ 4.3.4). The one design change: quorum-queue source ownership
is monitored through the management API rather than broker-enforced,
because quorum queues do not honor the exclusive-consume flag. The
proven fencing, handoff, and drain behaviors are folded into the
provider engine sections.

Signed-off-by: Thomas Hallgren <thomas@tada.se>
The telepresence.io/queue-config annotation gets a strict schema with
two-stage validation in pkg/queueconfig: provider-block rules at parse
time and pod-template rules (literal source env vars, restricted env
sources, TLS secrets already referenced by the container) against the
workload spec. pkg/queuestate holds the durable per-workload state
document, the activation/deactivation phase machine with per-phase
recovery actions, filter overlap detection, and bounded deterministic
naming for every broker and Kubernetes resource a split creates.

Signed-off-by: Thomas Hallgren <thomas@tada.se>
The Engine interface carries the split lifecycle -- prepare, fenced
start, route reconciliation, route drain, stop, application drain,
handoff commit, cleanup, and restart recovery -- with the shared
at-least-once delivery contract stated once in the package. A
provider-agnostic conformance suite encodes the lifecycle scenarios
against a per-provider broker probe, and both v1 engines pass it
against real brokers: Kafka (franz-go; offset-seeded activation,
static-membership and producer-epoch fencing, partition-preserving
pump, drain-group residue moves, frontier handback via group-offset
commit) and RabbitMQ (amqp091-go; management-API preflight with
queue-type parity, single-connection lock-queue fencing, confirmed
mandatory publishes, quiesce-and-recheck drains).

Signed-off-by: Thomas Hallgren <thomas@tada.se>
Signed-off-by: Thomas Hallgren <thomas@tada.se>
Move the route-filter predicate and the started/stopped/aborted lifecycle
(with its cleanup gate) into the engine package, drop DrainApplication's
unused Handoff parameter, dedup the RabbitMQ pump-resume and stop-consumer
sequences, batch Kafka cleanup's topic/group deletes and group describes,
build classification header maps lazily, and replace the Kafka conformance
probe's context-keyed scenario tracking with an explicit harness hook.

Signed-off-by: Thomas Hallgren <thomas@tada.se>
@thallgren
thallgren force-pushed the thallgren/queue-splitting branch from ed139cf to 1a2e5ba Compare August 18, 2026 13:08
@thallgren

Copy link
Copy Markdown
Member Author

Superseded by the simplified queue-splitting plan.

@thallgren thallgren closed this Aug 20, 2026
@thallgren
thallgren deleted the thallgren/queue-splitting branch August 20, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant