Repository navigation
fix: remove non-deterministic 25P02 pool ROLLBACK - #1260
Conversation
|
Warning Review limit reached
Your plan includes 5 reviews of capacity. Refill in 6 minutes. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR removes an explicit ChangesTransaction error handling cleanup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Code Review
This pull request removes a manual ROLLBACK operation from the WithTransaction function in pkg/database/client.go, as the previous implementation was non-deterministic. The reviewer recommends removing the IsAbortedTransactionError function if it has become dead code as a result of these changes.
I am having trouble creating individual review comments. Click here to see my feedback.
pkg/database/client.go (150-152)
The removal of this block is appropriate as the manual ROLLBACK on the pool was non-deterministic (it could execute on any connection in the pool, not necessarily the one that failed). However, since IsAbortedTransactionError is no longer used in this file, and it appears to have been specifically added for this logic, please verify if it is still used elsewhere in the codebase. If it is now unused, it should be removed from pkg/database/errors.go to avoid leaving dead code.
3d60e11 to
ece75d8
Compare
|
This change is part of the following stack:
Change managed by git-spice. |
The pool-level c.sdb.ExecContext("ROLLBACK") added for 25P02 recovery
can run on a different connection than the one with the aborted state
(database/sql ExecContext picks any idle pooled connection). Since the
DO NOTHING chunk-insert fix eliminates the root cause of 25P02, remove
the flawed recovery. IsAbortedTransactionError is kept as an exported
helper for future use.
ece75d8 to
4ccda55
Compare
Summary
ROLLBACKthat was added in theprevious commit to recover aborted-transaction connections.
DO NOTHINGfix, so the ROLLBACK is no longer needed.without connection-level control over
database/sql, so the codewas removed rather than left in with a misleading comment.
Why
The bare
ROLLBACKwas a defensive measure for connections alreadyin the aborted state. Now that no statement ever aborts the transaction,
the fallback is dead code that adds complexity without benefit.
🤖 Generated with Claude Code