Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-45638

PoC: Migrate Debezium Replication to use WAL vs Outbox

XMLWordPrintable

    • Product / Portfolio Work
    • False
    • Hide

      None

      Show
      None
    • 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:

       

              anatale.openshift Antony Natale
              anatale.openshift Antony Natale
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: