---
title: 租户短时间 DDL 过多导致备集群刷新 schema 内存不足卡住备集群同步的原因和处理方法-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于 租户短时间 DDL 过多导致备集群刷新 schema 内存不足卡住备集群同步的原因和处理方法相关的常见问题和使用技巧，帮助您快速解决 租户短时间 DDL 过多导致备集群刷新 schema 内存不足卡住备集群同步的原因和处理方法的难题。
---
切换语言

- 简体中文
- English

划线反馈

# 租户短时间 DDL 过多导致备集群刷新 schema 内存不足卡住备集群同步的原因和处理方法

更新时间：2026-05-09 07:56

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

## 问题现象

备集群的同步卡住，通过查询语句 `select * from __all_core_table where table_name like '%schema_status%';`，可以看到存在租户的 `created_schema_version` 为 0。

如下图所示。

![image1](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/high-avalibility/20241106havenotkeptmediumsnapshot4016.png)

备集群有节点的 OBServer 日志频繁打印日志 `single alloc size large than 4G is not allowed`。

```shell
rootservice.log.20241025090520:[2024-10-25 09:00:44.597425] WARN alloc (ob_tenant_ctx_allocator.h:113) [497929][648][xxxxx-xxxxx-xxxxx-xxxxx] [lt=18] [dc=5] [OOPS] alloc

failed reason: single alloc size large than 4G is not allowed(alloc_size: 4294967296)

```

备集群 rootservice.log 打印日志 `tenant refresh increment schema failed(ret=-4013`。

```shell
[2024-10-25 09:40:11.748716] WARN  [SHARE.SCHEMA] refresh_schema (ob_server_schema_service.cpp:4672) [497861][512][xxxxx-xxxxx-xxxxx-xxxxx] [lt=18] [dc=0] tenant refresh increment schema failed(ret=-4013, schema_status={tenant_id:1014, snapshot_timestamp:1729820285068201, readable_schema_version:1729647459847176, created_schema_version:0})

```

综上可知 rootservice.log 内打印此日志说明 schema 增量刷新报错 -4013，而问题现象中观测到 OBServer 日志内打印 `single alloc size large than 4G is not allowed` 证明是 schema 增量刷新时需要申请的内存过大导致刷新失败。

## 问题原因

接入备集群后因为租户新增的 DDL 语句过多，备集群需要在内存里面维护增量的 `__all_ddl_operation` 表的全部内容，由于这次增量的结果过大，超过内核每次可申请最大内存 4G 大小的限制，导致备集群进行 schema 刷新时报错-4013（内存不足）。

## 问题的风险及影响

备集群无法同步。

## 影响租户

影响 OceanBase 数据库中的 SYS 租户和 Oracle 租户以及 MySQL 租户。

## 适用版本

OceanBase 数据库 V2.2.76 版本。

## 解决方法及规避方式

- 解决方法：

  重启 rootservice 日志内有报错 `single alloc size large than 4G is not allowed` 的节点，让备集群执行全量刷新，全量刷新不会有此问题。
 - 规避方式：

  避免短时间内执行大量 DDL 语句。

Previous

[Switchover 相关的问题](https://www.oceanbase.com/knowledge-base/oceanbase-database-20000000086)

Next

[主备库同步正常但 switchover 多次重试才成功](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000208204) ![有帮助](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) 咨询热线
