-
Task
-
Resolution: Unresolved
-
Major
-
None
-
None
-
Product / Portfolio Work
-
False
-
-
False
-
None
-
Unset
-
None
-
-
Follow up on a recommend solution from investigating serialization errors in RHCLOUD-45441
The Concept:
Instead of INSERT+DELETE on the outbox table, emit the outbox event directly into the PostgreSQL Write-Ahead Log (WAL) as a logical decoding message using `pg_logical_emit_message()`. Debezium already reads from the WAL — this simply changes what it captures (logical decoding messages instead of table changes).
Why this works:
- No table operations at all — `pg_logical_emit_message()` writes directly to WAL without touching any table
- No predicate locks — Since no table is read or written, there are no SIRead locks to create rw-dependency cycles
- Transactional — The first argument (`true`) makes the message transactional, meaning it only appears in the WAL if the surrounding transaction commits
Deployment considerations
- The replication slot must be dropped and recreated when switching from table capture to logical decoding message capture. Any unconsumed WAL entries from the old configuration will not be compatible with the new SMT chain.
- The application code change (`pg_logical_emit_message` instead of INSERT+DELETE) and the connector reconfiguration should be deployed together. If the application is deployed first, WAL messages will accumulate in the slot but won't be processed until the connector is reconfigured. If the connector is reconfigured first, it will simply have no messages to process until the application is updated.
Useful Links:
- https://www.decodable.co/blog/the-wonders-of-postgres-logical-decoding-messages-for-cdc
- https://debezium.io/documentation//reference/3.1/transformations/decode-logical-decoding-message-content.html
- is caused by
-
RHCLOUD-45441 Investigate serialization errors in inventory-api outbox
-
- Closed
-