---
title: 因不同表创建了两个同名索引导致卡合并、无法执行 DDL，RS 日志告警 build index name hashmap failed 的原因及处理方法-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于因不同表创建了两个同名索引导致卡合并、无法执行 DDL，RS 日志告警 build index name hashmap failed 的原因及处理方法相关的常见问题和使用技巧，帮助您快速解决因不同表创建了两个同名索引导致卡合并、无法执行 DDL，RS 日志告警 build index name hashmap failed 的原因及处理方法的难题。
image: https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*OSPzQ6GUQF4AAAAAQHAAAAgAeiGDAQ/original
---
切换语言

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

划线反馈

# 因不同表创建了两个同名索引导致卡合并、无法执行 DDL，RS 日志告警 build index name hashmap failed 的原因及处理方法

更新时间：2026-05-22 08:56

适用版本： V4.0.x、V4.1.x、V4.2.x 内容类型：Troubleshoot  

## 问题现象

从 `CDB_OB_MAJOR_COMPACTION` 视图中查看到租户的 `STATUS` 长时间处于 `COMPACTING` 状态（合并卡住）。

![image001](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/sql/20241029notddloperation001.png)

且 `__all_virtual_compaction_diagnose_info` 视图中可以看到大量此租户 compaction 时的报错，error_code=-5627(schema刷新失败)

![image002](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/sql/20241029notddloperation002.png)

## 关键信息

关键日志：`build index name hashmap failed`。 发生异常后，rootservice 节点的 rootservice.log 内会打印 EDIAG 级别日志，完整关键日志如下。

```shell
[2024-10-12 14:33:02.476743] EDIAG [SHARE.SCHEMA] rebuild_table_hashmap (ob_schema_mgr.cpp:5033) [3341696][DDLQueueTh0][T0][xxxxx-xxxxx-xxxxx-xxxxx] [lt=19][errcode=0] build index name hashmap failed(ret=0, ret="OB_SUCCESS", hash_ret=-4200, hash_ret="OB_HASH_EXIST", tmp_ret=0, exist_table_id=675596, exist_database_id=523437, index_name=DSG_ROWID_3194, table_id=675708, databse_id=523437, index_name=DSG_ROWID_3194)

```

其中会显示两个冲突的同名索引表的表 id：exist_table_id=675596 和 table_id=675708。

## 问题原因

在对表新加唯一列（alter table add column same_name unique）时由于带了 unique 关键字，内核会分配随机索引名，但仅保证了同一个表内的索引名不重复，未保证不同表之间的索引名不重复。 问题发生时 RootService 服务检查发现两张表存在索引重名，进而导致 schema 刷新失败并不停重试。

## 问题的风险及影响

租户 schema 刷新卡住，合并会卡住，无法执行任何 DDL 操作。

## 影响租户

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

## 适用版本

OceanBase 数据库 V4.x 版本。

## 解决方法及规避方式

- 解决方法：

  遇到如上问题时，请联系 OceanBase 技术支持，在指导下修改内部表并轮转重启集群（仅做集群升级无法解决此问题）。

  #### 警告

  修改内部表存在一定的风险，请勿自行操作。如果需要修改，请联系 OceanBase 技术支持团队。
 - 规避方式

  避免并行执行 alter table add column 同名列 unique 操作。无法规避，但触发概率低。

上一篇

[创建索引卡住的原因及解决方法](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000002725522)

下一篇

[索引名太长导致 show triggers where/like 报错 Incorrect value 的原因和解决方法](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000002397186) ![有帮助](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) 咨询热线
