Skip to content

Provide an API to detect and remove orphaned entity_relationship rows (dangling Data Product edges) #33742

Open

Description

@jamiejackson

Is your feature request related to a problem? Please describe.

#33741

Orphaned entity_relationship rows (see linked bug: ghost Data Products) are undetectable and unremovable through the API. Today the only remediation is DELETE FROM entity_relationship WHERE fromId = '<uuid>' AND fromEntity = 'dataProduct'; run directly against the database -- version-coupled to the schema and unsafe as a routine operation against a production catalog.

Describe the solution you'd like

A supported, API-driven way to detect and reap orphaned relationships without direct DB access:

  • an integrity/consistency report that lists relationships whose endpoints no longer resolve, and
  • an admin endpoint or maintenance job to remove them.

Describe alternatives you've considered

  • Direct SQL DELETE against entity_relationship -- what we do now; rejected as a standing operation because it is schema/version-coupled and bypasses OM's own bookkeeping.
  • Search reindex -- does not apply; reindex rebuilds the ES projection from the store and does not prune orphaned relational rows (please confirm).
  • Client-side always-hardDelete=true&recursive=true -- does not help: we confirmed in a lab that the orphan is race-born and hard/recursive is clean only absent the race, so the delete mode is orthogonal. It also gives operators no way to clean up rows that already leaked.

Additional context

Ideally the primary fix is the correctness bug (no orphaned rows in the first place); this enhancement is the fallback for rows that leak via races or partial failures. Link the orphan bug issue here once opened. Related concurrency defect already filed: #33607 (AB-BA lock-order deadlock between two hard-delete paths) -- different mechanism, same entity_relationship neighborhood.

Pre-submission checklist

  • I searched for duplicate feature requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendenhancement

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions