问题现象
进行 switchover 主备切换时报错 -4179(OB_OP_not_allow),查看 v$ob_cluster 的 switchover_status 为 not_allow。


关键信息
v$ob_cluster的switchover_status为not_allow。switchover 失败,通过
v$ob_cluster_event_history查看 switchover 操作 10s 就报错OB_OP_not_allow。
问题原因
因为查询 v$ob_cluster 比较耗时,通常内部访问的 SQL 设置超过 10s 就报错(ob_query_timeout),如果没有在规定时间将内容访问出来则这个列就显示 not_allow。
问题的风险及影响
switchover 失败。
适用版本
OceanBase 数据库 V3.x 版本。
解决方法及规避方式
调节
ob_query_timeout(用于设置 SQL 最大执行时间),将其调大。OCP 有设置 session 级别的超时时间,也需要将其调大。
警告
在生产环境中调大 ob_query_timeout 和设置 OCP 的 session 级别的超时时间需整体评估对于性能的影响,请勿在生产库上自行调整,请联系咨询 OceanBase 技术支持团队获得帮助。