DM同步报错, failed to create table for in schema tracker\" RawCause:\"[schema:8239]Unknown placement policy 'on_ssd'

FYI,因为只要涉及到新表的创建,都会导致复制报错。这里补充一个生成修复语句的SHELL命令,可以放到crond里定时跑一下。

#! /bin/bash
PD_ADDR="127.0.0.1:8261"
cmds=$(tiup dmctl --master-addr ${PD_ADDR} query-status --more | jq -r '.sources[] | .sourceStatus.source as $src | .subTaskStatus[] | select(.stage == "Paused") | {name: .name, source: $src, info :.result.errors[].Message | capture("`(?<db>\\S+)`.`(?<table>\\S+)`")} | "binlog-schema update --from-source -s " + .source + " " + .name + " " + .info.db + " " + .info.table + "\nresume-task " + .name') 

echo "${cmds}" | while read cmd; do
    echo "------  $cmd ------"
    echo "$cmd" | tiup dmctl --master-addr  ${PD_ADDR}
    
done