Error is reported when concurrently merging nodes/edges
- Dominant language
- C
- Stars
- 4.8k
- Forks
- 523
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 9
Description
**Describe the bug**
When multiple clients perform merge edges concurrently, there is error reported, "sequence already exists", or "relation already exists".
Here is my code:
I try to fix this issue in this PR: https://github.com/apache/age/pull/2178. But the issue still exists.
**How are you accessing AGE (Command line, driver, etc.)?**
- python driver
**What data setup do we need to do?**
**What is the necessary configuration info needed?**
- [e.g. Installed PostGIS]
**What is the command that caused the error?**
```python
cq = f"""
--
| MATCH (source:{source_node_label} {{doc_id:'{doc_id}'}})
| MATCH (target:{target_node_label} {{doc_id:'{doc_id}'}})
| WITH source, target
| MERGE (source)-[r:DIRECTED]->(target)
| SET {set_properties}
| RETURN r
| """
| query = sql.SQL(
| f"SELECT * FROM cypher('{self.graph_name}', $$ {cq} $$) as (result agtype)"
| )
```
Error message is:
```
Key (relname, relnamespace)=(DIRECTED_id_seq, 42609) already exists.
```
Or
```
relation "DIRECTED" already exists
```
**Expected behavior**
A clear and concise description of what you expected to happen.
**Environment (please complete the following information):**
- Version: [e.g. 0.4.0]
**Additional context**
Add any other context about the problem here.
Contributor guide
Assessment
This issue has not been assessed yet.