Bug 1479340

Summary: [3.6][Backport][Registry][Pruning] Orphaned blobs cannot be pruned
Product: OpenShift Container Platform Reporter: Michal Minar <miminar>
Component: Image RegistryAssignee: Michal Minar <miminar>
Status: CLOSED ERRATA QA Contact: ge liu <geliu>
Severity: high Docs Contact:
Priority: urgent    
Version: 3.6.1CC: aos-bugs, dcaldwel, dmoessne, dyan, erich, geliu, jkaur, mfojtik, miminar, misalunk, xtian, yinzhou
Target Milestone: ---Keywords: Reopened
Target Release: 3.6.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: There was no way to prune orphaned blobs on integrated registry's storage. Consequence: The orphaned blobs could pile up and consume a considerable amount of free space. Fix: We provide a new low-level utility that is run inside of registry's container and removes the orphaned blobs. Result: Customers are now able to remove orphaned blobs retrieve storage space.
Story Points: ---
Clone Of: 1408676 Environment:
Last Closed: 2017-10-25 13:04:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1408676, 1499314, 1499315    
Bug Blocks: 1471844, 1472438    

Comment 1 Michal Minar 2017-08-08 11:58:02 UTC
Back-port PR: https://github.com/openshift/ose/pull/827

Comment 2 Brenton Leanhardt 2017-08-23 14:32:53 UTC
*** Bug 1467340 has been marked as a duplicate of this bug. ***

Comment 3 Michal Minar 2017-09-25 14:14:17 UTC
Merged from https://github.com/openshift/origin/pull/16126

Comment 4 Dongbo Yan 2017-09-26 09:17:57 UTC
Verified
openshift v3.6.173.0.37
kubernetes v1.6.1+5115d708d7
etcd 3.2.1

use nfs as registry back end storage
# oc -n default exec -i -t "$(oc -n default get pods -l deploymentconfig=docker-registry -o jsonpath=$'{.items[0].metadata.name}\n')" -- /usr/bin/dockerregistry -prune=delete
 
Deleted 4 blobs
Freed up 49.35 MiB of disk space

If use AWS S3 as registry back end storage
Deleted 0 blobs
Freed up 0 B of disk space

Do not work well, there is a bug (bz1483930) to track it, so could move this bug to verified

Comment 6 errata-xmlrpc 2017-10-25 13:04:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:3049