PostgresTimerStore
The TimerStore of one bounded context on PostgreSQL: a table per aggregate type, wow_timer__<context>__<aggregate>, in the database of the type's log (PostgresTimerTables), created on the type's first use and recorded in the registry wow_timer_aggregate.
Every write is autocommitted and goes to its owner's table: a put is an upsert whose conflict condition admits only another timer at the same or a later version; a cancel is a conditional update; a settle is one batch of conditional updates per table, each on the row as it was loaded. The due read takes every partition and every table in one statement, a UNION ALL of each table's read over its partial index of the PENDING timers, merged by due time; the same statement counts the registry's tables, so a table another node created since this store last read the registry is read again at once. A timer whose rule this version cannot read (a later version's) is skipped and warned of once per value; only a partition whose page came back full and held such a timer is read on past it, from the last row read (PostgresTimerTables.dueAfter), so those rows never starve the timers behind them.
JDBC calls run on dispatcher, virtual threads by default (JDK 21).
Constructors
Functions
Creates the registry of timer tables when missing; refuses one recorded in another format. Under a ddl that checks, then makes sure of each table the registry lists as its first use would (ensure), so a key or an index of one that differs refuses the start (#7686): those are the tables the due read reads. An aggregate type the registry does not list yet has its table made sure of at its first use.