Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sipity entities not cleaned up from DB after deletion #6001

Open
bbpennel opened this issue Apr 4, 2023 · 0 comments
Open

Sipity entities not cleaned up from DB after deletion #6001

bbpennel opened this issue Apr 4, 2023 · 0 comments

Comments

@bbpennel
Copy link
Contributor

bbpennel commented Apr 4, 2023

Descriptive summary

After deleting a work in a sipity workflow from a hyrax 3 or 4 instance the work will continue to appear in the sipity_entities table (and probably the other sipity tables as well). The record is cleaned out of solr, and becomes a fcr:tombstone in fedora, but lives on in the relational database forever.

For example, in my .dassie environment I deleted the work with id vt150j246, but if I check the database I still see:

hyrax=# select * from sipity_entities where proxy_for_global_id = 'gid://dassie/GenericWork/vt150j246';
 id |        proxy_for_global_id         | workflow_id | workflow_state_id |         created_at         |         updated_at         
----+------------------------------------+-------------+-------------------+----------------------------+----------------------------
  9 | gid://dassie/GenericWork/vt150j246 |           4 |                 6 | 2023-04-04 17:15:23.501994 | 2023-04-04 17:15:23.568498

Rationale

This is an issue since some pages are directly populated from queries of the database. For example, the Review Submissions page queries for sipity entities, and then looks those ids up in solr to return pages of results. The result is fewer than a full page of results will be returned, since the deleted items are returned from the DB but not found in solr.

Expected behavior

Sipity tables clear out entries related to deleted works.

Actual behavior

Sipity tables are unchanged when a work is deleted

Steps to reproduce the behavior

  1. Create a work in a workflow (such as the default Mediated workflow)
  2. connect to the database and query for the work (see query above)
  3. In the UI, delete the work
  4. Query the database again, you will see the entry still there

Related work

Relates to #5999 since this PR enables serverside paging for the Review Submissions page, which makes it visible when there are leftover deleted items in the sipity_entities table, since you can end up with pages of results that contain significantly fewer results than the page size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant