适用版本
OceanBase 数据库 V2.x和 V3.x 版本。
问题现象
OB 日志报错:OB_SIZE_OVERFLOW,-4019。
概述:[OB日志告警] ob_cluster=xxxx_DB:host=xxxx:server_type=observer:ob_error_code=4019
- 生成时间: 2024-01-20T03:24:00 08:00
- 详情:集群:xxxx_DB,主机:xxxx,日志类型:observer, 错误码:4019,TraceId:Y0-0000000000000000,日志名称:OB_SIZE_OVERFLOW,日志级别:error,日志详情:
[2024-01-20 03:23:33.930358] ERROR [LIB] runTimerTask (ob_work_queue.cpp:25) [83722][634][Y0-0000000000000000] [lt=12] [dc=0] failed to submit async task(ret=-4019
问题原因
在 OceanBase V4.0 版本之前,主备库的 DDL 同步速度不高,当主库集中创建大量 DDL 时,大量的 DDL 任务容易导致主备库之间的网络资源紧张,造成备库 DDL 创建任务的失败、重试以及任务积压,最终触发 OB_SIZE_OVERFLOW,-4019 报错。
排查步骤
在备库上查询 RS 历史事件表,查看是否有异常的任务执行,结果发现有大量的 copy sstable 任务执行报错:
-4605超时。obclient> select * from __all_rootservice_event_history where event like "%copy_sstable%" order by 1 desc limit 10;copy sstable 一般由负载均衡任务(balancer)执行,在备库查询
__all_virtual_rebalance_task_stat表,的确有大量的copy sstable 的任务。obclient> select * from __all_virtual_rebalance_task_stat;在备库查询
__all_ddl_helper表,查看到有大量的 DDL 任务未完成。obclient> select count(*) from __all_ddl_helper;说明
__all_ddl_helper中记录了备库需要从主库同步创建的 DDL。在主库查询
__all_virtual_dump_tenant_info,查看虚拟租户 509 的队列积压情况,发现存在队列积压。obclient> select * from __all_virtual_dump_tenant_info where tenant_id = 509;注意
509 租户是专门用来做主备同步的系统租户。
至此,我们确认
-4019的报错与备库同步 DDL 导致的任务积压有关。
解决方法
为了缓解这个现象,我们可以调小备库的负载均衡并发任务数,降低备库从主库同步创建 DDL 的任务数,减少竞争资源(网络)导致的任务失败概率。将备库的以下参数调小(比如调为 1):
server_data_copy_in_concurrency参数用于设置单个节点迁入数据的最大并发数,默认值为 2。obclient> alter system set server_data_copy_in_concurrency = 1; Query OK, 0 rows affected (0.062 sec)server_data_copy_out_concurrency参数用于设置单个节点迁出数据的最大并发数,默认值为 2。obclient> alter system set server_data_copy_out_concurrency = 1; Query OK, 0 rows affected (0.045 sec)migrate_concurrency参数用于设置内部数据迁移的最大并发数,默认值为 10。obclient> alter system set migrate_concurrency = 1; Query OK, 0 rows affected (0.042 sec)