-
Notifications
You must be signed in to change notification settings - Fork 413
Fix hang for TestCTE.Concurrent test #10662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughThe pull request refactors synchronization primitives in the CTE (Common Table Expression) operator to prevent deadlocks. A shared read-write lock replaces per-partition mutexes for protecting a broader set of state variables. Lock acquisition order is carefully adjusted during blocking waits to avoid circular wait conditions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/cc @windtalker @gengliqi |
|
/run-check-issue-triage-complete |
|
|
||
| CTEPartition & getPartitionForTest(size_t partition_idx) { return this->partitions[partition_idx]; } | ||
|
|
||
| std::shared_mutex * getRWLockForTest() { return &(this->rw_lock); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using a reference instead of a pointer?
| // For example: in `CTE::tryGetBlockAt`, we will lock rw_lock first then lock partition.mu. | ||
| // If locking partition.mu first here, `CTE::tryGetBlockAt` may have locked rw_lock. Then | ||
| // each of them needs to lock the other lock, but the other lock has been locked now. | ||
| rw_lock.lock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a sleep above this line of code?
What problem does this PR solve?
Issue Number: close #10636
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note