PostgresFailureLedger
The FailureLedger of one service on PostgreSQL (documentation/designs/04-subscriptions.md §2), in the service's own database: one row per parked (subscription, aggregate). The key starts with service, the service the ledger is of, then the subscription's context and name (SubscriptionId): services that share a database, and subscriptions of one name in two contexts, see and resolve only their own entries. The table's layout is recorded as format PostgresFailureLedgerTables.FORMAT (PostgresFormat), with an index answering what is due in a node's partitions and one answering a tenant's listing.
Every write is one autocommitted statement, whatever the autocommit default of the dataSource's pool. A park is an upsert that replaces the row's where and why only with an earlier from version, so concurrent or replayed parks converge on the earliest without a transaction; a repark is one update of an existing row; a resolve is one delete returning the removed row; an amendment with a statement of its own is one update returning the amended row at the next revision, conditional on the revision read when it claims, takes or schedules, and any other one (amendByRevision) a read and an update of the whole row conditional on the revision it read. The table holds the source partition and position of the entry, the retry state and the revision among its columns. A table of another format, or without a format record, is refused (PostgresFormat): nothing is converted. Key columns use the "C" collation, so list orders by code point on every database, whatever its default collation.
JDBC calls run on dispatcher, virtual threads by default (JDK 21).
Constructors
Functions
Claims the table's format (PostgresFormat) and creates it when missing.