-
Notifications
You must be signed in to change notification settings - Fork 289
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
key was too long error when dm replicating to downstream TiDB w/ non-default max-index-length #11459
Comments
I expect SchemaTracker will ignore the index length check Can you provide more log of dm-worker to locate the error? |
Oh I see it. Thank you! |
@lance6716 I wonder how you think about the approach of #11465 (increase the global max-index-length config for DM's schema tracker) vs trying to copy the tidb config, or updating ddl library to use non-default index length. I don't think it's a 1:1 guarantee that DDLs that fail against TiDB necessarily fail against the schema tracker? Would it be ok if the schema tracker was more lenient/permissive in these cases? |
I think schema tracker should skip all checking in DDL, to provide a most compatible DDL action. I will also try to fix it in tidb's schema tracker component. Your PR will be much quicker than my fix so I also hope we can merge it. |
What did you do?
we use dm to replicate tables between upstream mysql and downstream tidb. The table has different schema/index definition between mysql/tidb and downstream tidb and tidb has a larger-than-default max-index-length config (3306 > 3072).
upstream:
downstream:
dm task has config like:
source has config like:
What did you expect to see?
When we use DM to replicate between these tables we encounter the error like
Even though max-index-length setting is increased on the downstream tidb, it appears the dm schema tracker uses the default config which remains 3072. Additionally, the schema tracker tries to suppress these errors and run in non-strict SQL mode, but it only affects single column indexes w/ non-unique constraint.
What did you see instead?
We expected to see dm successfully replicate mutations between upstream and downstream. Additionally, we expect that dm would grab the relevant config from the downstream tidb rather than use the default.
Versions of the cluster
DM version (run
dmctl -V
ordm-worker -V
ordm-master -V
):Upstream MySQL/MariaDB server version:
(paste upstream MySQL/MariaDB server version here)
Downstream TiDB cluster version (execute
SELECT tidb_version();
in a MySQL client):How did you deploy DM: tiup or manually?
manually
Other interesting information (system version, hardware config, etc):
current status of DM cluster (execute
query-status <task-name>
in dmctl)The text was updated successfully, but these errors were encountered: