-
Notifications
You must be signed in to change notification settings - Fork 307
dm/tests: stabilize G11 on release-7.5 (ha_cases, lightning_mode) #12617
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
Open
joechenrh
wants to merge
2
commits into
pingcap:release-7.5
Choose a base branch
from
joechenrh:fix/release-7.5-dm-ci-g11
base: release-7.5
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+46
−4
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -51,6 +51,43 @@ function run() { | |||||||||
| run_dm_master_info_log $WORK_DIR/master $MASTER_PORT $cur/conf/dm-master.toml | ||||||||||
| check_rpc_alive $cur/../bin/check_master_online 127.0.0.1:$MASTER_PORT | ||||||||||
|
|
||||||||||
| # Pre-create Lightning's internal metadata tables. Each dm-worker spawns its | ||||||||||
| # own Lightning instance with the physical backend, and they race to | ||||||||||
| # bootstrap `lightning_metadata.task_meta_v2` / `table_meta` concurrently. | ||||||||||
| # TiDB's DDL schema cache can lag between the concurrent `CREATE TABLE IF | ||||||||||
| # NOT EXISTS` and the follow-up `SELECT`, yielding `Error 1146: Table ... | ||||||||||
| # doesn't exist` on one worker. Creating the tables ahead of time removes | ||||||||||
| # the race. The schemas mirror | ||||||||||
| # br/pkg/lightning/importer/import.go:CreateTaskMetaTable / CreateTableMetadataTable. | ||||||||||
| run_sql_tidb "CREATE DATABASE IF NOT EXISTS lightning_metadata;" | ||||||||||
| run_sql_tidb "CREATE TABLE IF NOT EXISTS lightning_metadata.task_meta_v2 ( | ||||||||||
| task_id BIGINT(20) UNSIGNED NOT NULL, | ||||||||||
| pd_cfgs VARCHAR(2048) NOT NULL DEFAULT '', | ||||||||||
| status VARCHAR(32) NOT NULL, | ||||||||||
| state TINYINT(1) NOT NULL DEFAULT 0 COMMENT '0: normal, 1: exited before finish', | ||||||||||
| tikv_source_bytes BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, | ||||||||||
| tiflash_source_bytes BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, | ||||||||||
| tikv_avail BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, | ||||||||||
| tiflash_avail BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, | ||||||||||
| PRIMARY KEY (task_id) | ||||||||||
| );" | ||||||||||
| run_sql_tidb "CREATE TABLE IF NOT EXISTS lightning_metadata.table_meta ( | ||||||||||
| task_id BIGINT(20) UNSIGNED, | ||||||||||
| table_id BIGINT(64) NOT NULL, | ||||||||||
|
Comment on lines
+75
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two issues in the table definition:
Suggested change
|
||||||||||
| table_name VARCHAR(64) NOT NULL, | ||||||||||
| row_id_base BIGINT(20) NOT NULL DEFAULT 0, | ||||||||||
| row_id_max BIGINT(20) NOT NULL DEFAULT 0, | ||||||||||
| total_kvs_base BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, | ||||||||||
| total_bytes_base BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, | ||||||||||
| checksum_base BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, | ||||||||||
| total_kvs BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, | ||||||||||
| total_bytes BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, | ||||||||||
| checksum BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, | ||||||||||
| status VARCHAR(32) NOT NULL, | ||||||||||
| has_duplicates BOOL NOT NULL DEFAULT 0, | ||||||||||
| PRIMARY KEY (table_id, task_id) | ||||||||||
| );" | ||||||||||
|
|
||||||||||
| # start DM task | ||||||||||
| dmctl_start_task "$cur/conf/dm-task-dup.yaml" "--remove-meta" | ||||||||||
| run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ | ||||||||||
|
|
||||||||||
Oops, something went wrong.
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.
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.
There is a likely discrepancy in the schema name. While this code creates tables in
lightning_metadata, line 97 of this script expects conflict results indm_meta_test. In DM, the Lightning metadata schema is typically configured as{meta_schema}_{task_name}(e.g.,dm_meta_test). If the workers are usingdm_meta_test, pre-creating tables inlightning_metadatawill not resolve the race condition. Please verify the actual schema name used by the task. Additionally, thelightning_metadatadatabase is created but never dropped; it should be added to the cleanup logic.