dm icon indicating copy to clipboard operation
dm copied to clipboard

check replication privileges of source DB for mariadb 10.5.11

Open luyomo opened this issue 4 years ago • 7 comments

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error. 1.1 Compiled the dm directly because of the ARM version 1.2 Set up the lastest version of mariadb(5.5) 1.3 Could not pass the previlege check

The root cause is that the [REPLICATION CLIENT] has been renamed to [BINLOG MONITOR] .

  1. What did you expect to see? Sync the data from mariadb to TIDB properly.

  2. What did you see instead? { "result": false, "msg": "[code=26005:class=dm-master:scope=internal:level=medium], Message: fail to check synchronization configuration with type: check was failed, please see detail detail: { "results": [ { "id": 6, "name": "source db replication privilege checker", "desc": "check replication privileges of source DB", "state": "fail", "errors": [ { "severity": "fail", "short_error": "line 1 column 71 near "MONITOR ON . TO dmuser@% IDENTIFIED BY PASSWORD '*8E20346B00C26BF7B9D921E21BF21D05D055D25D'" " } ], "extra": "address of db instance - 192.168.1.109:3306" }, { "id": 5, "name": "source db dump privilege checker", "desc": "check dump privileges of source DB", "state": "fail", "errors": [ { "severity": "fail", "short_error": "line 1 column 71 near "MONITOR ON . TO dmuser@% IDENTIFIED BY PASSWORD '*8E20346B00C26BF7B9D921E21BF21D05D055D25D'" " } ], "extra": "address of db instance - 192.168.1.109:3306" } ], "summary": { "passed": false, "total": 8, "successful": 6, "failed": 2, "warning": 0 } }", "sources": [ ] }

  3. Versions of the cluster

    • DM version (run dmctl -V or dm-worker -V or dm-master -V):

      /opt/dm/bin/dmctl --version 
      

Release Version: v2.0.0-beta.2-392-gd103118d-dev Git Commit Hash: d103118d5cf074e34d8b7246f49cf3211f263ca1 Git Branch: master UTC Build Time: 2021-07-02 09:30:52 Go Version: go version go1.16.4 linux/arm64 ```

- Upstream MySQL/MariaDB server version:

    ```
   Enter password: 

Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 94 Server version: 10.5.11-MariaDB-1:10.5.11+maria~focal-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. ```

- Downstream TiDB cluster version (execute `SELECT tidb_version();` in a MySQL client):

    ```
    MySQL [(none)]> select tidb_version();

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | tidb_version() | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Release Version: v5.0.2 Edition: Community Git Commit Hash: dc40a093a0058b95fc859f60d4b84337dbdff9f6 Git Branch: heads/refs/tags/v5.0.2 UTC Build Time: 2021-06-09 14:40:45 GoVersion: go1.13 Race Enabled: false TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 Check Table Before Drop: false | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.008 sec) ```

- How did you deploy DM: DM-Ansible or manually?

    ```
    manually
    ```

- Other interesting information (system version, hardware config, etc):

    >
    >
  1. current status of DM cluster (execute query-status in dmctl)

  2. Operation logs

    • Please upload dm-worker.log for every DM-worker instance if possible
    • Please upload dm-master.log if possible
    • Other interesting logs
    • Output of dmctl's commands with problems
  3. Configuration of the cluster and the task

  4. Screenshot/exported-PDF of Grafana dashboard or metrics' graph in Prometheus for DM if possible

luyomo avatar Jul 05 '21 01:07 luyomo

This is the URL for your reference, can we do the test for the mariad latest version? [REPLICATION CLIENT] has been renamed to [BINLOG MONITOR] https://github.com/saltstack/salt/issues/58297

luyomo avatar Jul 05 '21 01:07 luyomo

I think the mariadb(5.5) is not the latest version, there's a version restriction in doc https://docs.pingcap.com/tidb-data-migration/stable/overview#usage-restrictions


oh, you mean 10.5, I'll take a look

lance6716 avatar Jul 05 '21 01:07 lance6716

to disable this precheck, you could refer to https://docs.pingcap.com/tidb-data-migration/stable/precheck#disable-checking-items to add

ignore-checking-items: ["replication_privilege"]

in the task configuration file. below is an example in integration tests.

https://github.com/pingcap/dm/blob/6aa96423db1476e8af2cbbb55a28e49bde674f88/tests/downstream_more_column/conf/dm-task-incremental.yaml#L9

lance6716 avatar Jul 05 '21 02:07 lance6716

Worked for me. Thanks for your instruction.

luyomo avatar Jul 05 '21 02:07 luyomo

Worked for me. Thanks for your instruction.

Thanks for your confirmation, I'll let this issue open as a TODO.

lance6716 avatar Jul 05 '21 02:07 lance6716

there're other limitations of MariaDB as a upstream, like password plugin https://mariadb.com/kb/en/authentication-plugin-ed25519/ so we might add supported version and limitations to official doc of DM.

For this priviledge problem, we acknowledged that parser could treat "BINLOG MONITOR" exactly same as "REPLICATION CLIENT"+"REPLICATION SLAVE".

lance6716 avatar Jul 06 '21 08:07 lance6716

rest troublesome privileges are BINLOG REPLAY and CONNECTION ADMIN

lance6716 avatar Oct 26 '21 12:10 lance6716