archesproject / arches

Arches is a web platform for creating, managing, & visualizing geospatial data. Arches was inspired by the needs of the Cultural Heritage community, particularly the widespread need of organizations to build & manage cultural heritage inventories
GNU Affero General Public License v3.0
219 stars 143 forks source link

bulk_deleter.delete_tiles will delete some tiles but not all if it fails on an exception #10858

Open whatisgalen opened 6 months ago

whatisgalen commented 6 months ago

The delete_tiles() method in the bulk data deleter should either delete all tiles as dictated by its request or else delete none of them. Also, there is also no count reported of how many tiles got deleted. It would be good to return a count upon successful deletion.

Mark0047 commented 4 months ago

I can work on this but I need some directions for DeleteAll or None. One way would be to use rollback but I need a file/code so I can learn how the project follows that.

chiatt commented 4 months ago

This could be a complex problem to solve because I don't believe bulk deletion is wrapped in a transaction that you can easily roll back. This is because the data volume could be very large. You would need to restore the data from the edit history and then reindex. This could be a very long running process inside a celery task, and the user would need to be notified that something went wrong and the deletion is getting reversed.