首批通过分布式安全可靠测评,为关键业务系统打造
OceanBase 创建索引 hang,系统报错 -4023
更新时间:2026-05-22 08:56
问题描述
OceanBase 数据库创建索引卡住,从 __all_rootservice_event_history 中和 observer.log 中均看到 -4023 报错,日志内容如下。
WARN [CLOG] get_last_archived_log_info (ob_partition_log_service.cpp:3803) [114995][1454][xxxxx-xxxxx] [lt=18] [dc=0] incarnation or archive round is not the same, need retry(ret=-4023, partition_key={tid:xxxxx, partition_id:22, part_cnt:0}, incarnation=1, archive_round=1, log_archive_status_={status:0, start_ts:-1, archive_incarnation:0, log_archive_round:0, last_archived_log_id:xxxxxx, last_archived_log_ts:-1, clog_epoch_id:-1, accum_checksum:0})
WARN [STORAGE] get_curr_clog_info_ (ob_partition_group.cpp:3817) [114995][1454][xxxxx-xxxxx] [lt=11] [dc=0] failed to get_last_archived_log_info(ret=-4023, ret="OB_EAGAIN", pkey_={tid:xxxxx, partition_id:22, part_cnt:0}, info={status:{tenant_id:1, start_ts:xxxxx, checkpoint_ts:0, status:2, incarnation:1, round:1, status_str:"BEGINNING"}, backup_dest:"file:///data/1/backup"})
WARN [STORAGE] get_curr_storage_info (ob_partition_group.cpp:3868) [114995][1454][xxxxx-xxxxx] [lt=11] [dc=0] fail to get curr clog info(ret=-4023, pkey_={tid:xxxxx, partition_id:22, part_cnt:0})
适用版本
OceanBase 数据库 V2.x 和 V3.x 版本。
问题原因
归档缓慢或者卡主,导致索引创建无法继续。
创建索引过程中需要复制 SSTable(类似于副本的迁移操作),为了避免复制过程中发生切主可能导致的归档日志的不连续,要求复制 SSTable 时 leader 的归档日志点位要大于副本的点位。
如果归档缓慢,或者备份盘满而不能归档,则索引创建会被卡住。
解决方法
需要解决日志备份延迟的问题,才能解决创建索引卡住的问题。