DataCrate360

Incident Lab · SEV2 · Postgres

Deleted customers are back in the CRM sync

Privacy: two customers who had their accounts deleted got this week's marketing email.

logical replication slot cdc_customers: emitted DELETE for customer_id=2 (lsn 107), customer_id=3 (lsn 110)

cdc customers is the change feed from the app's Postgres database. Every insert, update and delete arrives as a row with op ( I , U , D ) and an increasing lsn . dim customers filters out the D rows first and then keeps the latest remaining change per customer. For a deleted customer, that picks the change right before the delete, so the customer comes back. Investigate: Note customer 4: deleted, then signed up again with the same id. Fix dim customers : take the latest change per customer id (by lsn ), then drop customers whose latest change is a delete. Columns: customer id , email , plan , ordered by customer id .

Start this incident · All incidents