Andrey Antukh 747e79c95a ♻️ Give every audit-log consumer the same drain
The transport had three chunk functions repeating the same shape: take
the lock timeout, read the rows of the chunk, do the work and complete
the batch. Only the work differed, and the shape was copied three
times.

The drain is now one function: it owns the transaction per chunk, the
lock mode (the consumers that archive block on the oldest rows to keep
the arrival order; the ones that do not archive take the rows with SKIP
LOCKED, so they never wait on an archive job holding them), the
completion of the batch, the housekeeping and the metrics. Every
consumer only provides the processor that does its work over the rows
of its chunk, and the lock mode is a datum of the consumer table
instead of a hardcoded id.

No behavior change: the same queues drain, the same teams get marked,
the same metrics and the same logs land.

AI-assisted-by: minimax-m3.1-flash
2026-10-23 16:32:06 +00:00
..
2026-10-23 16:32:06 +00:00
2026-10-07 10:41:29 +02:00
2024-05-29 19:05:04 +02:00