-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
import: check table empty skips using index #39604
Conversation
[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. |
/run-integration-br-test |
Integration BR test failed at |
/run-unit-test |
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.
please fix unit tests, rest lgtm
// In Lightning, if previous importing is halted half-way, it is possible that | ||
// the data is partially imported, but the index data has not been imported. | ||
// In this situation, if no hint is added, the SQL executor might fetch the record from index, | ||
// which is empty. This will result in missing check. |
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.
it's still possible that index data in partially imported.
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.
it's still possible that index data in partially imported.
If index data is partially imported, table-empty check will report errors on the second import even if USE INDEX()
is not used. So it will be figured out by the current table-empty-check logic.
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7ebf3c3
|
tried on
mysql> show create table test.t;
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`id` int(11) NOT NULL,
`v` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
mysql> select 1 from test.t limit 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.01 sec) |
/run-integration-br-test |
/hold |
seems when table rows is small, tidb will use full-table-scan(previous case only has 4 rows)
|
/unhold |
You can use the data introduced in c0e0c3c , which is reproducible. |
/run-integration-br-test |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 85052b1
|
TiDB MergeCI notify🔴 Bad News! [1] CI still failing after this pr merged.
|
/cherry-pick release-6.1 |
@dsdashun: new pull request created to branch In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
Signed-off-by: ti-chi-bot <[email protected]>
/cherry-pick release-6.5 |
@dsdashun: new pull request created to branch In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #39477
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.