Problem
Some blobs marked soft deleted ( deleted=true inside the blob properties file ) in a file based blobstore may not be hard deleted after repeated runs of the Admin - Compact blobstore task.
S3 based blobstores are not affected by the Admin - Compact blobstore task and this article does not apply to those types of blobstores.
Diagnosis
The Admin - Compact Blob store task relies on a deletions index file to know which blobs should be hard-deleted.
Although each soft-deleted blob has a property within the associated .properties file that flags it as such, the deletions index file is the only thing that the Compact Blobstore task will use for performance reasons.
It is possible for the deletions index to be missing blobs, perhaps due to errors when they are deleted such that their IDs do not get added to the index. In this case, the blobs are effectively orphaned and will not be picked up during compaction.
How to rebuild a file based blobstore deletions index file
Locate the file based blobstore containing the soft-deleted blobs which were not deleted by the Admin - Compact blobstore task.
Add the following line to the metadata.properties file in the root directory of the blobstore.
rebuildDeletedBlobIndex=true
For example, the default file based blobstore metadata properties file is relative to the install dir at ../sonatype-work/nexus3/blobs/default/metadata.properties
The next time that the Admin - Compact Blobstore task is run, it will iterate over all of the properties files in the blobstore, looking for the deleted=true attribute and rebuild the index file.
The task will run longer than usual, depending on the size of the blobstore and I/O performance.
Once the task has successfully completed, the property will be automatically be removed from metadata.properties and so that the index will not rebuild again on the next run of the task.