How does garbage collection works

In the process of moving one of my node to a new harddrive, I forgot to run rsync with delete options.
So now I have a node that have extra blob that it is not supposed to be there.
Will garbage collection detects these extra blob and delete it?

Yes, garbage collection will clean up any pieces that shouldn’t be there. It works using bloom filters. That’s a sort of compressed piece of data that with clever code will check pieces if they match. All pieces you should have will match the bloom filter. All the pieces that don’t match will get cleaned up. Though about 10% of pieces your node shouldn’t have will also match that bloom filter. So it will take more than one run to clean up everything.


Garbage collection uses a data structure called Bloom filters, some explanations are provided in this thread: How bloom filters work

This could make your databases corrupted, because database journals were not deleted

1 Like