预检查会检查租户的分区限制,当分区超限后会触发报错。
详细说明
预检查脚本的位置是 /home/admin/oceanbase/etc/upgrade_checker.py。
通过查看预检查脚本发现检查的逻辑如下。
# 检查租户分区数是否超出内存限制
def check_tenant_part_num(query_cur):
# 统计每个租户在各个 server 上的分区数量
(desc, res_part_num) = query_cur.exec_query("""select svr_ip, svr_port, table_id >> 40 as tenant_id, count(*) as part
_num from __all_virtual_clog_stat group by 1,2,3 order by 1,2,3""")
# 计算每个租户在每个 server 上的 max_memory
(desc, res_unit_memory) = query_cur.exec_query("""select u.svr_ip, u.svr_port, t.tenant_id, uc.max_memory, p.replica_
type from __all_unit u, __All_resource_pool p, __all_tenant t, __all_unit_config uc where p.resource_pool_id = u.resou
rce_pool_id and t.tenant_id = p.tenant_id and p.unit_config_id = uc.unit_config_id""")
# 查询每个 server 的 memstore_limit_percentage
(desc, res_svr_memstore_percent) = query_cur.exec_query("""select svr_ip, svr_port, name, value from __all_virtual_s
ys_parameter_stat where name = 'memstore_limit_percentage'""")
part_static_cost = 128 * 1024
part_dynamic_cost = 400 * 1024
发现这里会检查租户的 max_memory 和 memstore_limit_percentage。
所以遇到这个错误有以下解决方案。
删除一些租户的副本分区。
扩大租户的内存(建议)。
把租户的
memstore_limit_percentage调大(不建议)。
影响租户
影响 OceanBase 数据库中的 SYS 租户和 Oracle 租户以及 MySQL 租户。
适用版本
OceanBase 数据库 V2.x、V3.x 版本。