Conversation
endrju19
changed the base branch from
fix/deliverer-validation-117-118
to
main
September 26, 2026 10:10
Add route-aware claims and a matching index for PostgreSQL and MySQL. Rotate the first route between batches, reject unsafe custom stores, and prevent a single deliverer from processing an entry of another type. Cover heterogeneous workers, concurrent claims, migrations, and a million-row Docker benchmark. Document the custom-store and rolling-upgrade requirements. Closes #116
endrju19
force-pushed
the
fix/route-aware-claim-116
branch
from
September 26, 2026 10:18
83c1985 to
a4b6894
Compare
Resolve conflicts with the merged deliverer validation and outbox-id changes. Link both schema migrations and explain the required MySQL index and PostgreSQL concurrent migration. Replace the timing-based HTTP concurrency test with a request barrier.
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Workers now claim only
PENDINGentries for their registered delivery types. The processor rotates its starting type and uses at most two claim queries per batch, independent of the number of types: one for the starting type and, when needed, oneINquery for the rest. A mismatched entry is also rejected before delivery.PostgreSQL gets a partial
(delivery_type, created_at, id) WHERE status = 'PENDING'index; MySQL gets(status, delivery_type, created_at, id)plus an exact, binary type check for case-insensitive collations. The unrestrictedOutboxStore.claimPending(limit)remains available to direct callers and keeps its existing index. Custom stores used by Okapi's processor must implementRouteAwareOutboxStore; Spring autoconfiguration rejects an unsafe store at startup.Verification
./gradlew build ktlintCheckpassed locally, covering all modules and database, HTTP, Kafka and Spring Boot tests.ktlintCheckpassed.INclaim used the route index and took about 0.16 ms on PostgreSQL and 0.21 ms on MySQL in local measurements. The previous full PostgreSQL index produced a 165 ms scan for that case. Scripts and context are inbenchmarks/route-aware-claim/.Rollout
The branch includes the current main, preserving #119 startup validation and #115 outbox-id headers. For manually managed schemas, the README links both migrations: apply 001 and 002 in order for a new installation, or apply 002 before starting updated workers on an existing schema. Run PostgreSQL migration 002 outside a transaction because it creates the index concurrently. Older workers can still claim unsupported types, so publish a new type only after all old processors are upgraded or stopped. Previously
FAILEDrows need separate recovery.Closes #116