首批通过分布式安全可靠测评,为关键业务系统打造
OceanBase 数据库集群因 enable_rebalance 参数未开启导致 UNIT 迁移等相关操作卡住
更新时间:2026-07-02 15:41
问题现象
OceanBase 数据库集群在进行集群扩容或缩容时,命令发起成功,但是等了很久任务都无法完成,__all_rootservice_job 显示状态一直是 INPROGRESS,无其他报错或异常。
MySQL [oceanbase]> select * from oceanbase.__all_rootservice_job order by gmt_create desc;
+----------------------------+----------------------------+--------+-------------------------------+------------+-------------+----------+-----------+-------------+-------------+---------------+----------+------------+--------------+-------------+----------+---------+-------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+------------------+---------------+-----------------+
| gmt_create | gmt_modified | job_id | job_type | job_status | return_code | progress | tenant_id | tenant_name | database_id | database_name | table_id | table_name | partition_id | svr_ip | svr_port | unit_id | rs_svr_ip | rs_svr_port | sql_text | extra_info | resource_pool_id | tablegroup_id | tablegroup_name |
+----------------------------+----------------------------+--------+-------------------------------+------------+-------------+----------+-----------+-------------+-------------+---------------+----------+------------+--------------+-------------+----------+---------+-------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+------------------+---------------+-----------------+
| 2025-01-12 21:37:22.702016 | 2025-01-12 21:37:22.702016 | 44 | DELETE_SERVER | INPROGRESS | NULL | 0 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | xx.xxx.x.xx | 2882 | NULL | xx.xxx.x.xx | 2882 | NULL | NULL | NULL | NULL | NULL |
| 2025-01-12 21:30:12.076804 | 2025-01-12 21:30:12.076804 | 43 | MIGRATE_UNIT | INPROGRESS | NULL | 0 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | xx.xxx.x.xx | 2882 | 2 | xx.xxx.x.xx | 2882 | NULL | NULL | NULL | NULL | NULL |
问题原因
OceanBase 数据库集群未开启 enable_rebalance 导致,扩容、缩容等操作依赖负载均衡模块,该参数控制了 OceanBase 数据库负载均衡是否可以正常执行。
关键信息
关键日志:
如日志信息中出现 can_do_rebalance=false、config_->is_rebalance_enabled()=false,则可以证明。
[2025-01-13 12:34:24.487991] INFO [RS.LB] ob_root_balancer.cpp:891 [922892][0][xxxxx-xxxxx-xxxxx-xxxxx] [lt=5] [dc=0] [BALANCER] [TENANT_BALANCE] check can do balance(tenant_id=1, can_do_rebalance=false, can_do_recovery=true, low_priority_task_info_cnt=0, high_priority_task_info_cnt=0, config_->is_rereplication_enabled()=true, config_->is_rebalance_enabled()=false, task_mgr_->get_low_priority_task_info_cnt()=0, ret=0, ret="OB_SUCCESS")
问题的风险及影响
扩容、缩容长时间卡住无法执行。
影响租户
影响 OceanBase 数据库中的 SYS 租户和 Oracle 租户以及 MySQL 租户。
适用版本
OceanBase 数据库 V2.x、V3.x、V4.x 版本。
解决方法
如果 enable_rebalance 未开启,则打开 enable_rebalance 即可解决。
规避方式
进行相关操作前检查参数 enable_rebalance 是否正常开启。