当日志中出现 partition table update task cost too much time to execute 的报错时,表示发生了分区无主的问题。
[2022-11-15 17:58:44.940099] ERROR [SERVER] check_task_status (ob_partition_table_updater.cpp:109) [31447][514][YB420A13BF2A-0005ED7CC845929D] [lt=8] partition table update task cost too much time to execute(*this={part_key:{tid:1099511627777, partition_id:0, part_cnt:1}, data_version:0, first_submit_time:1668495238245390, is_remove:false, with_role:true}, safe_interval=120000000, cost_time=11086694694, interval=1800000000) BACKTRACE:0xd0c11fa 0xcfeb547 0x9bcafc4 0x9bcb088 0x9bcb16b 0x9be8ee6 0x9b92162 0x5f1c72a 0x3ad1aec 0xce719c7 0xce6f720 0xce6d50f
导致分区无主的原因很多,可能是 clog 同步的异常,也可能与时钟偏移有关。
- clog 滑动窗口超过一定的时间不能完成滑动,会导致 Leader 的卸任。
- 新的 Leader 上任时,如果不能在限定的时间内完成 Reconfirm 操作,会导致上任失败,产生无主。
- 网络延迟、时钟偏移等原因,无法在选举周期内收到多数派的投票,会导致无主。
适用版本
OceanBase 数据库 V2.x、V3.x 版本。