pingcap / tiflow

This repo maintains DM (a data migration platform) and TiCDC (change data capture for TiDB)
Apache License 2.0
430 stars 286 forks source link

Unhelpful instruction for MariaDB #11734

Open dveeden opened 2 weeks ago

dveeden commented 2 weeks ago

What did you do?

Try to setup DM with MariaDB 11.4.2 as upstream

What did you expect to see?

No response

What did you see instead?

{
    "result": true,
    "msg": "",
    "sources": [
        {
            "result": false,
            "msg": "[code=38032:class=dm-master:scope=internal:level=high], Message: some error occurs in dm-worker: ErrCode:11001 ErrClass:\"functional\" ErrScope:\"internal\" ErrLevel:\"high\" Message:\"parse mydumper metadata error: [code=11123:class=functional:scope=upstream:level=low], Message: didn't found binlog location in dumped metadata file metadata, Workaround: Please check log of dump unit, there maybe errors when read upstream binlog status, metadata: Started dump at: 2024-11-08 16:30:53\\nSHOW BINARY LOG STATUS:\\n\\tLog: mysqld-bin.000002\\n\\tPos: 329\\n\\tGTID:\\n\\nFinished dump at: 2024-11-08 16:30:54\\n\" , Workaround: Please execute `query-status` to check status.",
            "source": "mysql-01",
            "worker": "127.0.0.1:8262"
        }
    ],
    "checkResult": "fail to check synchronization configuration with type: no errors but some warnings
        detail: {
        "results": [
            {
                "id": 3,
                "name": "mysql_version",
                "desc": "check whether mysql version is satisfied",
                "state": "warn",
                "errors": [
                    {
                        "severity": "warn",
                        "short_error": "Migrating from MariaDB is still experimental."
                    }
                ],
                "instruction": "It is recommended that you upgrade MariaDB to 10.1.2 or a later version.",
                "extra": "address of db instance - 127.0.0.1:3307"
            }
        ],
        "summary": {
            "passed": true,
            "total": 13,
            "successful": 12,
            "failed": 0,
            "warning": 1
        }
    }"
}

Note the "It is recommended that you upgrade MariaDB to 10.1.2 or a later version.",

Versions of the cluster

master @ 64decf62203ff818af81756368e3f302af36f946

current status of DM cluster (execute query-status <task-name> in dmctl)

(paste current status of DM cluster here)
dveeden commented 2 weeks ago

Also looks like the output isn't valid JSON cc @lance6716

dveeden commented 2 weeks ago

/label MariaDB

lance6716 commented 1 week ago

The instruction message is not clear. I think the purpose is not fixing the precheck warning after follows the instruction, but remind user to avoid using old MariaDB versions which have more problems 😂

Also looks like the output isn't valid JSON

Yes I checked the code, seems currect format is deliberately processed by PrettyPrintResponseWithCheckTask to provide visual readability 😂

dveeden commented 1 week ago

@lance6716 can we fix this so the output is valid again? (and maybe add a test for that)

I guess we may have to create a custom Marshaler instead of doing text replacements on the output.

This somewhat reminds me of end_markers_in_json in MySQL.

mysql-9.1.0> explain format=json select 1\G
*************************** 1. row ***************************
EXPLAIN: {
  "query_block": {
    "select_id": 1,
    "message": "No tables used"
  }
}
1 row in set, 1 warning (0.00 sec)

mysql-9.1.0> set end_markers_in_json=on;
Query OK, 0 rows affected (0.00 sec)

mysql-9.1.0> explain format=json select 1\G
*************************** 1. row ***************************
EXPLAIN: {
  "query_block": {
    "select_id": 1,
    "message": "No tables used"
  } /* query_block */
}
1 row in set, 1 warning (0.00 sec)

Maybe the pretty printing should be a config option?

lance6716 commented 1 week ago

cc @alastori @OliverS929

dveeden commented 1 week ago

To be clear. This issue is about the instruction not being helpful. I've created a separate issue for the output not being valid JSON

fubinzh commented 1 week ago

/severity moderate