-
Notifications
You must be signed in to change notification settings - Fork 2
Description
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:
- Remove the procedures
- Add a table in postgres that can be handled by the data service tasks deployment
- 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.