Skip to content

Fix stale pg_class stats for dead letter and outgoing table counts - #2459

Merged
jeremydmiller merged 1 commit into
mainfrom
fix/postgresql-dead-letter-tests
Apr 8, 2026
Merged

jeremydmiller merged 1 commit into
mainfrom
fix/postgresql-dead-letter-tests

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Summary

  • After Use pg_class estimation for outgoing and dead letter table counts #2392 switched FetchCountsAsync to use pg_class estimation for outgoing and dead letter tables, afterTruncateEnvelopeDataAsync was not updated to ANALYZE those tables after bulk deletes
  • This caused stale reltuples values to produce incorrect counts (e.g. counts.DeadLetter returning 3 instead of 1)
  • Now always runs ANALYZE on dead letter and outgoing tables after truncation, matching the existing pattern for partitioned incoming tables

Fixes the 3 persistently failing tests in CI (run):

  • move_dead_letter_messages_as_replayable_by_id_to_incoming
  • move_replayable_error_messages_to_incoming
  • delete_dead_letter_message_by_id

Test plan

  • All 38 PostgresqlMessageStoreTests pass locally
  • All 10 dead letter related tests pass across test classes

🤖 Generated with Claude Code

…ation failures

After commit 1262a27 switched FetchCountsAsync to use pg_class estimation
for outgoing and dead_letter tables, afterTruncateEnvelopeDataAsync was not
updated to ANALYZE those tables after bulk deletes. This caused stale
reltuples values to produce incorrect counts in tests that delete and
re-insert dead letter rows.

Fixes the 3 failing PostgresqlMessageStoreTests in CI:
- move_dead_letter_messages_as_replayable_by_id_to_incoming
- move_replayable_error_messages_to_incoming
- delete_dead_letter_message_by_id

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeremydmiller
jeremydmiller merged commit 18c13f4 into main Apr 8, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant