问题现象
备份恢复指定白名单,恢复过程中卡在 MODIFY_SCHEMA 阶段。
在 RS 上可以搜到如下日志信息。
[2024-07-25 15:09:50.811312] WARN [RS.RESTORE] modify_schema (ob_restore_scheduler.cpp:1823) [84325][0][xxxxx-xxxxx-xxxxx-xxxxx] [lt=3] [dc=0] fail to filter schema(ret=-6224, ret="OB_TRANS_NEED_ROLLBACK", ......
以及使用 trace 搜如下日志信息。 [2024-07-25 15:09:50.768706] WARN [SQL.EXE] setup_next_scanner (ob_direct_receive.cpp:311) [84214][0][xxxxx-xxxxx-xxxxx-xxxxx] [lt=11] [dc=0] while fetching first scanner, the remote rcode is not OB_SUCCESS(ret=-4012, err_msg="", dst_addr=""xxx.xxx.xxx.xxx:xxxx"")
且配置项 rpc_timeout < 10s。
问题原因
OceanBase 数据库 V2.x,V3.x 版本的表级恢复的 MODIFY_SCHEMA 阶段会过滤 schema,删除与恢复的白名单中的表无关的 schema 对象。此处删除的 DML 的超时时间为 MIN(rpc_timeout, 10),如果要删除的表在 __all_histogram_stat_v2 中有较多的记录,删除语句可能耗时超过 10s 超时时间。
问题的风险及影响
表级恢复卡住。可能对客户应急恢复造成影响。
影响租户
影响 OceanBase 数据库中的 SYS 租户和 Oracle 租户以及 MySQL 租户。
适用版本
OceanBase 数据库 V2.2.x、V3.x 版本。
解决方法
暂时调大集群内部请求的超时时间 rpc_timeout(默认值为 2s),无需重启 OBServer 生效。