p2panda / aquadoggo

Node for the p2panda network handling validation, storage, aggregation and replication
GNU Affero General Public License v3.0
70 stars 5 forks source link

Cascade deletes on application documents to any `blob_v1` documents they refer to #518

Closed sandreae closed 1 year ago

sandreae commented 1 year ago

This would mean changing the logic in the garbage_collection task to purge blobs when a document which relates to them is deleted, if no other documents relate to them as well.

sandreae commented 1 year ago

This is actually reflected in the current behaviour. If a document receives a DELETE operation, the materializer reduces it and issues a garbage_collection task. Any unused views will be pruned, if this removes all relations to blob_v1 document, then it is purged from the node. Rather than "cascading deletes" this is actually the behaviour we want.

There's even a test to prove it: https://github.com/p2panda/aquadoggo/blob/45b70e19c0648d1dc8a1ba9917859cf876842b0f/aquadoggo/src/materializer/tasks/garbage_collection.rs#L431-L504

So I am closing this issue :+1: