[M-01] Fix Non-atomic Reorg Cleanup in DeleteLogsAndBlocksAfter#421
Conversation
|
👋 dhaidashenko, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
📊 API Diff Results
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a transactional correctness bug in the log poller ORM where reorg cleanup deletes could run outside the intended database transaction, making the cleanup non-atomic.
Changes:
- Ensure
DeleteLogsAndBlocksAfterexecutes its DELETE statements using the transactional ORM datasource (orm.ds) insideTransact. - Add a regression test that detects accidental execution on the outer connection pool datasource.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/logpoller/orm.go |
Switch DELETE execution from o.ds to transactional orm.ds within Transact to guarantee atomic cleanup. |
pkg/logpoller/orm_test.go |
Add a datasource wrapper + test to confirm DeleteLogsAndBlocksAfter uses the transactional datasource (no pool ExecContext calls). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.