阈值与健康范围
正常场景:
理想值:TSO Wait Duration 应稳定在 ≤ 1ms(同一机房内 PD 与 TiDB 直连)。
可接受范围:若跨低延迟网络(如同城专线),建议控制在 ≤ 5ms。超过此值需排查。
风险阈值:
警告线:持续超过 10ms 可能导致事务冲突率升高、AP 查询排队堆积。
临界线:偶发尖峰超过 50ms 可能直接触发客户端超时(需紧急处理)。
Ticdc中日志信息:
[2025/01/26 02:19:24.727 +08:00] [INFO] [region_worker.go:243] [“single region event feed disconnected”] [changefeed=auto-order] [regionID=277934170] [requestID=23125] [span=“[748000000000005aff295f72800000001aff87d4b60000000000fa, 748000000000005aff295f72800000001aff8b0dc80000000000fa)…
CDC中设置为10M,是否有可能会有大的SQL过来>10M ,而导致同步失败的情况? max-batch-size=256 这个还要改不?
背景:
我们在做IDC容灾双活, 用CDC来做不同机房2个集群A-1,A-2之间同步,平时A1是主库可读写,A-2只读或热备。 想问下这种情况下, TIDB自带的的一些库是否要A1–>A2同步? 如看上去 PERFORMANCE_SCHEMA这种是和集群本身相关,是不该同步的
问: 这些TIDB自带库,哪些要同步,哪些不该同步?
[image]用dumpling/tidb-lightning: 成功。
./bin/dumpling -h 10.xx -P 4000 -udbxx -plsxxx -B community -T community.sq_visit_user_deviceid --filetype sql -t 64 -o /data/dbatemp/tmp/community_sq_visit_user_deviceid_843 -r 200000 -F256MiB
tiup tidb-lightning:v7.5.3 -config tidb-lightning-commentnew.toml
尝试手动执行SQL出错:
[image]
数据很奇怪,表中显示有deviceid=‘8ddd29fa45f3df8baa1b50ff272c94eaa09a6989’,但是select 不出来。
[image]目标实例上tidb-server log:
[image]
2024/11/06 22:28:52.299 +08:00] [ERROR] [session.go:773] [“assertion failed”] [conn=2191605662] [session_alias=] [message=“[tikv:8141]assertion failed: key: 7480000000000001f05f698000000000000002010038004400440044ff0032003900460041ff0034003500460033ff0044004600380042…
admin checkinformation_schema > select * from tables where tidb_table_id=496\G;
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: community
TABLE_NAME: sq_visit_user_deviceid
TABLE_TYPE: BASE TABLE
ENGINE: InnoDB
VERSION: 10
ROW_FORMAT: Compact
…
日志文本:
[2024/11/05 14:23:03.819 +08:00] [INFO] [syncer.go:252] [“handleSuccess quit”]
[2024/11/05 14:23:03.819 +08:00] [ERROR] [syncer.go:488] [“Failed to close syncer”] [error=“Error 8141: assertion failed: key: 7480000000000001f05f69800000000000000201003800440
0440044ff0032003900460041ff00340035…
原因是:虽然安装了pump,但是binlog没有开。
binlog.enable: false
处理:
tiup cluster edit-config clustername
binlog.enable: true
改进:提前检查好binlog,pump status。
upload_pic > show variables like “log_bin”;
±--------------±------+
| Variable_name | Value |
±--------------±------+
| log_bin | ON |
±-------…
已看。 Pd并没有加入到集群中。
step 1:
bin/pd-ctl -u “10.x.x.1:2379” member
bin/pd-ctl -u “10.x.x.1:2379” health
step2:
ls -l /etc/systemd/system/node_exporter-9100.service #stop
sudo systemctl stop pd-2379.service
sudo systemctl stop tidb-4000.service
sudo systemctl stop cdc-8300.service
sudo systemct…
集群备份
br backup full --filter ‘test.’ --filter 'mytest.’ --ratelimit 1024 --pd “10.x.x.:2379” --concurrency 1024 --storage s3://tidbbackup/br_backup_test --send-credentials-to-tikv=true --s3.endpoint
http://10.x.x.x.x:9000 --log-file /tmp/x.log ;date
#还原
br restore full --filter ‘test.’ --filt…
stmt-count-limit
TiDB 单个事务允许的最大语句条数限制。
默认值:5000
在一个事务中,超过 stmt-count-limit 条语句后还没有 rollback 或者 commit,TiDB 将会返回 statement count 5001 exceeds the transaction limitation, autocommit = false 错误。该限制只在可重试的乐观事务中生效,如果使用悲观事务或者关闭了事务重试,事务中的语句数将不受此限制。
max-txn-row 同步的batch大小,默认256.
答:
193:8300 是CDC节点。
…
日志信息:
9262 [2024/10/21 19:14:33.607 +08:00] [INFO] [statistics.go:154] [“sink replication status”] [name=mysql] [changefeed=atpub-motobike] [capture=10.x.x.x:8300] [count=0] [qp
s=0] [ddl=0]
79263 [2024/10/21 19:14:41.497 +08:00] [WARN] [mysql.go:903] [“execute DMLs with error, retry later”] [err…