Repository navigation
fix(permalink): backport shared lock on concurrent permalink re-read to 6.2 (#45102) - #45152
Closed
luizotavio32 wants to merge 1 commit into
Closed
luizotavio32 wants to merge 1 commit into
luizotavio32 wants to merge 1 commit into
Conversation
…ted permalink (apache#45102) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit cb8ff28)
Comment on lines
+128
to
+130
| entry = KeyValueDAO.get_entry( | ||
| self.resource, uuid_key, lock=RowLock(read=True) | ||
| ) |
Contributor
There was a problem hiding this comment.
Suggestion: With PostgreSQL REPEATABLE READ, FOR SHARE cannot see a row committed after the transaction snapshot, so this returns None and re-raises the duplicate-key failure.
Assessment: 🟠 Major · 🔁 Occurrence: Rarely · 🏷️ Race condition
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** superset/commands/dashboard/permalink/create.py
**Line:** 128:130
**Comment:**
*Race Condition: With PostgreSQL `REPEATABLE READ`, `FOR SHARE` cannot see a row committed after the transaction snapshot, so this returns `None` and re-raises the duplicate-key failure.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 6.2 #45152 +/- ##
======================================
Coverage ? 64.28%
======================================
Files ? 2557
Lines ? 133430
Branches ? 30897
======================================
Hits ? 85777
Misses ? 46173
Partials ? 1480
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Backport of #45102 to 6.2.
On 6.2, bursts of 3 or more identical permalink requests for the same dashboard can still return 500 on MySQL. Each request that loses the race re-reads the winner's row with an exclusive lock while already holding a shared lock on it, so the losers wait on each other and MySQL aborts one with a deadlock. This backport makes that re-read take a shared lock instead.
The distributed-lock release and report-config changes from the original PR are left out, since that code doesn't exist on 6.2.
TESTING INSTRUCTIONS
Unit tests from the original PR are included.
ADDITIONAL INFORMATION
🤖 Generated with Claude Code