Problem/Motivation
Cron performs one unbounded DELETE and suppression queries apply LOWER() to recipient despite a plain recipient index. This can become expensive as retained event history grows; no throughput benchmark has established a current production threshold.
Evidence and scope
Reviewed 1.0.0-alpha1, source commit 02fd9d36af5237e712cecb7155d79725f7824880. Location: postmark_webhooks.module:48.
Source inspection only; performance risk, not a measured outage.
Proposed resolution
Benchmark realistic history sizes on supported databases, add portable indexed normalized lookup/state access, and make retention cleanup resumable in bounded batches. Keep legacy mixed-case correctness. Add queueing only if measured ingestion latency justifies its complexity and acknowledge only after durable storage.
Acceptance criteria
Record query plans and bounded runtime/memory, test concurrent cron and insertion, and prove batch boundaries do not alter suppression or idempotency. Avoid database-specific optimizations without a portable fallback.
Comments
Comment #2
jmcerdaImplemented restartable cleanup of at most 250 expired history rows per cron call. It uses the existing receipt-time index and rechecks selected primary keys and cutoff on deletion. Durable suppression remains untouched. Tests on Drupal 10 and 11 cover batch boundaries, late arrivals, and two cleanup processes racing with a webhook receiver. A local PostgreSQL benchmark with 100,000 history rows and 10,000 suppression records used index scans for cleanup and normalized recipient lookup; one cleanup took about 12–15 ms. The full suite passes (46 tests per core version). Benchmark limits and backlog behavior are documented; integration and release remain pending.
Comment #5
jmcerdaIntegrated into the 1.x development branch and included in 1.0.0-alpha2. The release tag and branch are mirrored to Drupalcode. The six-job Drupal 10/11 and Mailer Plus integration matrix passes. See the release notes for database updates and retained-history limitations. This records module publication; site deployment is a separate operation.