Open karenhanson opened 6 years ago
@karenhanson can this be closed?
IIRC, there is no support for "hard deletes" anywhere in RMap, so at the moment the indexer doesn't need to support them. If hard delete support needs to be tracked, maybe we can add an issue for that separately?
Ah @karenhanson I see hard-delete is a function of the admin tool. Let me see if I can easily update the indexer to accommodate.
@karenhanson ok, it looks like the code should accommodate hard-deletes: the indexer treats them the same as tombstones (the documents for the deleted disco are removed from the index).
What is missing is an integration test for hard-delete.
Is there a way I can simulate a hard-delete using the API or UI in an integration test?
@emetsger This test simulates delete: https://github.com/rmap-project/rmap/blob/be5a42462152a1343657c7be84fca61b8e28b138/webapp/src/test/java/info/rmapproject/webapp/controllers/AdminToolControllerTest.java#L233-L252 This is the method that actually does the deletion work - it creates an Admin Agent in RMap if one doesn't already exist and then uses that Agent to delete the DiSCO: https://github.com/rmap-project/rmap/blob/be5a42462152a1343657c7be84fca61b8e28b138/webapp/src/main/java/info/rmapproject/webapp/service/RMapUpdateServiceImpl.java#L64-L70 The description provided goes into RMapEvent.description
Deletion and tombstone Events against a DiSCO only affect the target DiSCO version. Other versions in the lineage maintain their current status.
DiscosSolrOperations.deleteDocumentsForLineage(String lineageUri)
appears to delete all DiSCOs in a lineage when a DiSCO deletion occurs, To match RMap's behavior, it should only act on the DiSCO version that is the target of the deletion or tombstone Event. Here is an example to illustrate how statuses can change within a lineage: