Skip to content

Error is reported when concurrently merging nodes/edges #2179

@mdianjun

Description

@mdianjun

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:

Image

I try to fix this issue in this PR: #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?

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions