Skip to content

Conversation

@alexluong
Copy link
Collaborator

@alexluong alexluong commented Jan 21, 2026

Remove DeliveryEvent concept

This PR replaces the monolithic DeliveryEvent type with purpose-specific types that better represent the different stages of event delivery.

New Types

  • DeliveryTask - Message type for delivery processing queues. Flows from publishmqdeliverymq and from retry → deliverymq. Contains the Event, DestinationID, Attempt, and Manual flag. Provides IdempotencyKey() for deduplication.

  • RetryTask - Message type for scheduling retries. Contains only the metadata needed to re-fetch the event and re-attempt delivery (EventID, TenantID, DestinationID, Attempt). Converts to DeliveryTask when the retry fires.

  • LogEntry - Message type for the log queue. Contains both Event and Delivery for persistence to the logstore.

  • DeliveryRecord - Query result type returned by logstore. Contains Delivery with optional Event population for API responses.

Logstore Interface Changes

  • InsertManyDeliveryEventInsertMany(events, deliveries)
  • ListDeliveryEventListDelivery (returns DeliveryRecord)
  • RetrieveDeliveryEventRetrieveDelivery (returns DeliveryRecord)

Other Changes

  • Removes delivery_event_id column from database schema
  • Removes legacy /delivery-events API endpoints
  • Idempotency now uses event_id:destination_id format (with :manual suffix for manual retries)

alexluong and others added 9 commits January 22, 2026 03:49
- Rename interface methods: InsertManyDeliveryEvent -> InsertMany,
  ListDeliveryEvent -> ListDelivery, RetrieveDeliveryEvent -> RetrieveDelivery
- Rename request types: ListDeliveryEventRequest -> ListDeliveryRequest, etc.
- Add DeliveryRecord type for query results with Event and Delivery
- Update memlogstore, pglogstore, chlogstore implementations
- Update all API handlers and tests to use new interface
- Remove DeliveryEventID field from Delivery struct

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add DeliveryTask struct with IdempotencyKey() and RetryID() methods
- Update deliverymq to publish/consume DeliveryTask instead of DeliveryEvent
- Update publishmq to create and enqueue DeliveryTask
- Update RetryTask to convert to DeliveryTask
- Update API handlers, eventtracer, alert, emetrics to use DeliveryTask
- Fix Delivery fields (TenantID, Attempt, Manual) not being set before logging
- Add :manual suffix to idempotency key for manual retries

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update chlogstore/README.md method names and SQL examples
- Update pglogstore/README.md method names
- Update tracer_test.go comment to reference DeliveryTask

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
outpost-docs Ready Ready Preview, Comment Jan 21, 2026 11:04pm
outpost-website Ready Ready Preview, Comment Jan 21, 2026 11:04pm

Request Review

Preserves Event-Delivery pairing through the insert flow, eliminating
the need for eventMap reconstruction in ClickHouse implementation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

2 participants