---
title: 业务偶发收到 the observer or zone is not the master 原因-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于 业务偶发收到 the observer or zone is not the master 原因相关的常见问题和使用技巧，帮助您快速解决 业务偶发收到 the observer or zone is not the master 原因的难题。
---
切换语言

- 简体中文
- English

划线反馈

# 业务偶发收到 the observer or zone is not the master 原因

更新时间：2024-01-22 01:56

适用版本： V2.1.x、V2.2.x、V3.1.x、V3.2.x 内容类型：Troubleshoot  

## 问题现象

业务程序偶发收到 `the observer or zone is not the master` 异常。

## 问题原因

该异常出现的原因是存在副本无主导致，可能发生了切主行为。

## 影响版本

OceanBase 数据库 V2.x 和 3.x 版本。

## 解决方法及排查方式

如果该问题是偶发低频出现，一般不需要特殊处理。但如果该问题高频出现或一直不恢复，则需要进行排查确认原因。下面是排查方法。

1. 确认问题时间点是否发生了切主行为。

      - 如果可以连接 sys 租户，执行如下 SQL 来进行查询。

       ```sql
       select * from __all_virtual_election_event_history where  gmt_create between '问题开始时间' and '问题结束时间' order by gmt_create;

       ```
      - 如果无法连接到 sys 租户，则可以使用 `table_id` 过滤对应时间点的 RS 日志进行确认。
 2. 分析切主行为是否符合预期，常见的异常切主原因为如下几种。

      - leader lease expired：租约过期，节点间的网络或者时钟可能存在问题。
      - disk error：磁盘异常。
      - clog reconfirm timeout：reconfirm 超时异常，异常原因需要具体分析。
      - clog sliding_window timeout：滑动窗口超时异常，异常原因需要具体分析。
      - clog disk full：clog 磁盘异常。
      - clog disk hang：clog 磁盘异常。

Previous

[大事务导致内存分配失败, 导致切主失败](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000245502)

Next

[手动切主 Zone 到其他机房场景应急演练流程](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000207641) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
