Three weeks after a release, finance notices that a bug has been writing wrong tax amounts to about 2% of orders ever since.
Likely causes → Silent logical corruption: the system kept working and nothing alerted, so bad data mixed with good data for weeks. Restoring a backup would throw away three weeks of valid orders, and backups may not even go back that far.
Diagnose → Find the release that introduced it, the exact start and end time, and a query that identifies the affected rows (recompute the tax from line items and compare). Check downstream copies too: the warehouse, invoices already sent, accounting exports.
Fix → Fix the bug and deploy first. Then repair the data with a reviewed backfill script that recomputes the correct values for affected rows, runs in batches, and logs before/after values. Work with finance and legal on corrected invoices and customer communication.
Prevent → Data quality checks that compare derived values with their inputs, reconciliation jobs against external systems (payments, accounting), audit columns (who and which version wrote each row), and backups or event logs retained long enough to rebuild from.