-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: use internal executor for FK validation checks #37339
Conversation
Switching to the internal executor instead of `delegateQuery` for FK validation queries. Release note: None
Hm, it looks like sometimes logic tests time out because the internal query deadlocks (I see a MaybeWaitForPush). I can only assume it's waiting on the parent transaction. Any idea why that would be the case (we are providing the same txn to the internal executor)? |
I think this might be because delegate can use the executor's current table descriptor, but the internal executor looks up the real, persisted state of the table descriptor. Are there modifications happening to table scheams or constraints in transactions? I think @lucy-zhang might be familiar with this class of problem. |
Indeed,
VALIDATE runs this internal query:
The lease code deadlocks inside |
Talked to Andrei, we probably want to pass more of the executor state (not just the |
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.
this code is suffering from #34304
i don't think you want to take on fixing that issue. @lucy-zhang is working presently on moving validation out of the user transaction to another transaction. Perhaps the best course of action here is to not move forward with this PR or at least wait for that PR to land.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andreimatei)
The PR that Vivek mentioned, to move the validation out of the user transaction (and do it as part of ADD CONSTRAINT), is #37433. |
Great! Does that PR also move the checking to a separate transaction when we do VALIDATE, or just for ADD CONSTRAINT? |
It does not change the behavior of |
To move forward here, we'd need to move up the work to run the To give more context for this PR: I am trying to retire all code paths that rely on the heuristic planner and can't use the optimizer. One of these is |
#37433 replaces Is this what you had in mind? (I took a closer look at this issue today, and realized I also had the same |
Thank you Lucy! Yeah, it looks like your change contains what I tried to do here, and for that I salute you! |
Switching to the internal executor instead of
delegateQuery
for FKvalidation queries.
Release note: None