---
title: "Refresh OBServer location cache failed OBServer 刷新 location cache 失败 | OceanBase 文档中心"
description: Refresh OBServer location cache failed OBServer 刷新 location cache 失败 告警描述 OBServer 刷新 locatition cache 失效，租户 SQL 可能超时，可能影响业务。 告警原理 OCP-Agent（ocp_monagent） 监控 O…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*lJTmRZ61jSUAAAAAAAAAAAAADiGDAQ/original) 云平台 OCPV 4.2.0 企业版

# Refresh OBServer location cache failed OBServer 刷新 location cache 失败

更新时间：2026-06-23 08:36:19

## 告警描述

OBServer 刷新 locatition cache 失效，租户 SQL 可能超时，可能影响业务。

## 告警原理

OCP-Agent（ocp_monagent） 监控 OBServer 的运行日志，有 2 个场景会出现这个告警。

1. 当日志持续 1 分钟出现如下关键字时产生告警：

   ```SQL
   LOCATION_STATISTIC
   SYS_CORE
   suc_cnt=0
   sql_suc_cnt=0

   ```

   上述可以用一个正则表达式来描述：`.\*LOCATION_STATISTIC.\*SYS_CORE.\*suc_cnt=0.\*sql_suc_cnt=0.\*` 。
 2. 出现如下关键字：

   ```SQL
   fail to check is local server.*ret=-4018

   ```

## 告警信息

| 告警触发方式 | 告警等级 | 范围 |
| --- | --- | --- |
| 基于 OceanBase 日志解析 | 严重 | 服务器 |

## 规则信息

| 监控指标 | 默认阈值 | 持续时间 | 检测周期 | 消除周期 |
| --- | --- | --- | --- | --- |
| NA | NA | 1 分钟 | 1 分钟 | 5 分钟 |

## 告警模板

- 告警概述模板：${alarm_name}] ${alarm_target}
 - 告警详情模板：集群：${ob_cluster_name}，主机：${host}，告警：${alarm_name}。日志文件：${filename}，日志级别：${log_level}，关键字 = ${keyword}，错误码 = ${error_code}，TraceId = ${trace_id}，日志详情 = ${error_message}。
 - 告警详情样例： 集群：TEST_CLUSTER，主机：xxx.xxx.xxx.xxx，告警：OBServer 刷新 location cache 失败。日志文件：/home/admin/oceanbase/log/observer.log，日志级别：info，关键字 = .*LOCATION_STATISTIC.*SYS_CORE.*suc_cnt=0.*sql_suc_cnt=0.*，错误码 = -1，TraceId=YB4221BC464C-0005E787BCF9D46A，日志详情 = [2023-04-26 14:03:35.555318] INFO [SHARE.PT] ob_location_update_task.cpp:88 [18597][734][YB4221BC464C-0005E787BCF9D46A] [lt=35] [dc=0] [LOCATION_STATISTIC] dump location cache statistics(queue_type="SYS_CORE", suc_cnt=0, fail_cnt=0, sql_suc_cnt=0, sql_fail_cnt=1, total_cnt=1, avg_wait_us=0, avg_exec_us=1537290) 。

## 对系统的影响

由于 location 信息不对，可能对系统造成如下影响：

1. 业务 SQL 超时。
 2. sys 租户队列积压，可采用 `dump tenant info` 关键字查看 `req_queue:total_size` 查看是否积压。

## 可能原因

已知系统故障。

## 处理方法

1. 系统租户直连 OBServer 节点。
 2. OBServer 节点故障时建议执行以下语句，用来刷新 location cache：

   ```SQL
   select count(*) from oceanbase.__all_virtual_proxy_schema where tenant_name = "sys" and database_name = "oceanbase" and table_name = "all_core_table" and partition_id = 0;

   ```
 3. 如果执行 **步骤2** 无效，建议重启机器。
 4. 一个不常见的场景也可能存在此问题：如果集群中的在租户曾经通过 locality 变更下掉 R，而且后续 delete 了 R 副本所在的 observer/zone，在切主（运维触发或者故障触发）等场景，日志持续报错 “fail to check is local server(ret=-4018)”，您可直连集群所有 OBServer 节点，并执行 `alter system flush location cache` 刷新 location cache。

 上一篇 下一篇 ![有帮助](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) 咨询热线
