适用版本
OceanBase 数据库 V2.x 和 V3.x 版本。
OCP V3.2.0 之前的版本。
问题现象
经核查发现,备份集的状态一直为 DELETING。
obclient> select * from CDB_OB_BACKUP_SET_DETAILS where tenant_id=1 limit 30;
检查日志,发现文件删除时间很长,例子中为 4.77 小时。
rootservice.log.20221215102106:[2022-12-15 10:20:29.786454] WARN [STORAGE] print_access_storage_log (ob_storage.cpp:38)[13671][686][YB420A16063E-0005E11034276E95] [lt=20] [dc=0] access storage op=del_file uri=file:///obbackup_04/skobc04/3/incarnation_1/1015/clog/12/index/1116004302328880 size=0 Byte cost_ts=17194923166 us speed=0.00 MB/s
问题原因
通过下述命令,发现 du 命令很多,本案例中进程数达到 270。
ps aux|grep du|wc -l
由于 OCP 开启的 du 操作多,导致操作系统的 load 高,使得备份清理缓慢。
解决方法
kill 相关的 du 命令,并参照《du 指令 hang 住导致主机不可用告警》的步骤,优化 OCP 的 du 命令调度逻辑。