-
Notifications
You must be signed in to change notification settings - Fork 5.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
executor: forbid read from stale query result #25954
Conversation
Signed-off-by: xhe <[email protected]>
Signed-off-by: xhe <[email protected]>
Signed-off-by: xhe <[email protected]>
Signed-off-by: xhe <[email protected]>
Signed-off-by: xhe <[email protected]>
Signed-off-by: xhe <[email protected]>
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.
lgtm
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
@Yisaer Please merge. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 758108e
|
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.1 in PR #26200 |
@ichn-hu The fix is a non-elegant workaround due to limitations of TiDB code base. It is not closed because we wanted to do some improvements later. But it is hard. What do you prefer? Open a new issue that may exist for a long time, or just change the name of the old issue. |
I am okay with either way, but if we change the name of the old issue, please make it a feature request and remove the type/bug label. Our team is currently in bug jail, so we need to do so, sorry for bringing inconvenience. |
Signed-off-by: xhe [email protected]
What problem does this PR solve?
Refer #25876
Problem Summary: Because the design of planner,
select
SQL in the view is not preprocess/checked while creating. I mean all thehandleTableName
are ignored due toinCreateOrDropTable
mask.Stale reads, however, relies on
handleTableName
to get the needed information. And I did not come up with a solution to only preprocess/check-staleness for the table name in theselect
part but view name.The result is that, I can not tell if it is a stale query while executing DDL
create view
, nor can we tell while executing/optimizing. Not from the preprocess result of the whole SQL. It can be extracted from theas ...
part, though.The check is added in the creation process(DDL) to reduce performance impact. It is added in executor, however, due to cyclic imports between planner and ddl.
Check List
Tests
Release note