Skip to content

Some entity removal does not update the search #931

@olevski

Description

@olevski

Related to #928 and #927

We have stored procedures in postgres to allow for deletion of things when their slugs are deleted.

The reason for this is that we have foreign keys in postgres that cascade deletions in one direction but not in another.

However the problem is that when we delete things like this via these stored procedures we do not update the search.

One possible solution to this is to:

  1. Remove the procedures
  2. Add a table in postgres that can be handled by the data service tasks deployment
  3. When a deletion that is not covered by foreign keys happens that would have been removed by the procedures we add an entry in the table an that data service tasks do the proper cleanup and update the search.

We could potentially avoid the extra table in postgres by having the data tasks recognize stranded entities that would be missing a connection to the other table where the deletion happened. Then the data tasks can simply delete such cases

For now the workaround is to do a search reprovisioning when we have cases like this.

EDIT: The search needs to remove child resources from its index. Not just the high level parents. With this change we do not have to mess with the stored procedures.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions