apache / apache/hugegraph

[Bug] 创建了uniqueIndex,使用相同id创建导致顶点,导致创建失败

Open
#1,475 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.2k
Forks
636
Avg merge
3d 11h
Merged PRs (30d)
14

Description

Note ( 特别注意, 点击展开 )

### Note ( 特别注意 ) :

> 1. 请先**搜索**, 并**确认**现有的 [Issues](https://github.com/hugegraph/hugegraph/issues) 与 [FAQ](https://hugegraph.github.io/hugegraph-doc/guides/faq.html) 中没有与您相同 / 相关的问题, 请勿重复提交
> 2. 我们需要尽可能**详细**的信息来**复现**问题, 越详细的信息 (包括**日志 / 截图 / 配置**等) 会**越快**被响应和处理
> 3. Issue 标题请保持原有模板`[分类]`, 长段描述之间可以增加空行或使用`序号`标记, 保持排版清晰
> 4. 请关注提交的 issue, 缺乏信息 / 长时间 ( > 14 天) 没有回复, issue 可能会被 **关闭** (更新时会再开启)

## Environment ( 环境信息 - 必填 )
- **Server Version**: v0.11.x (refer [here](https://hugegraph.github.io/hugegraph-doc/clients/restful-api/other.html))
- **Backend**: Cassandra 3.x, x nodes, HDD or SSD
- **OS**: xx CPUs, xx G RAM, Centos 7.x
- **Data Size**: xx vertices, xx edges

## Expected behavior ( 期望表现 )
正常创建
xxx

## Actual behavior ( 实际表现 / 报错)
{
"exception": "class java.lang.IllegalArgumentException",
"message": "Unique constraint indexUniqueDataColumnGloableNameValid(id=413) conflict is found for v[3528345736695513088]",
"cause": ""
}
xxx

```java
// Error info ⬇ (尽可能详细的日志 + 完整异常栈)

```

## How to reproduce ( 复现步骤 )
1. 建立uniqueIndex,
![image](https://user-images.githubusercontent.com/31173360/120454625-a559d180-c3c6-11eb-9410-4b7f658d0555.png)
![image](https://user-images.githubusercontent.com/31173360/120454818-cd493500-c3c6-11eb-9c6d-f3b3eebb4d06.png)

2. 指定id创建顶点
![image](https://user-images.githubusercontent.com/31173360/120454545-8f4c1100-c3c6-11eb-92c4-22b032f6a8b1.png)

3. 使用相同id创建不同名称顶点
![image](https://user-images.githubusercontent.com/31173360/120455030-fc5fa680-c3c6-11eb-9ec3-333e7b885810.png)
此时仍然只有一个顶点,step-2创建的顶点被此次创建的数据覆盖了,
![image](https://user-images.githubusercontent.com/31173360/120455180-1b5e3880-c3c7-11eb-9f2f-a75cae45f4cf.png)

4. 使用step-2中的名称再次创建,此时会抛出异常,唯一索引冲突
![image](https://user-images.githubusercontent.com/31173360/120455332-40eb4200-c3c7-11eb-8025-419740e79379.png)

**Refer:** [How to create a minimal reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example)

### Vertex/Edge example ( 问题点 / 边数据举例 )
在step2覆盖原来的数据之后,再次创建时应该是可以正常创建,2而不应该出现异常信息
```javascript
// JSON of Vertex / Edge ⬇

```

### Schema [VertexLabel, EdgeLabel, IndexLabel] ( 元数据结构 )

```javascript
// JSON of GraphSchema ⬇

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.