Bug 1471844 - [3.4][Registry][Pruning] Orphaned blobs cannot be pruned
[3.4][Registry][Pruning] Orphaned blobs cannot be pruned
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image Registry (Show other bugs)
3.4.1
Unspecified Unspecified
urgent Severity urgent
: ---
: 3.4.z
Assigned To: Michal Minar
ge liu
: Reopened
Depends On: 1479340 1408676 1467340 1472438
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-17 10:22 EDT by Michal Minar
Modified: 2017-09-19 05:28 EDT (History)
13 users (show)

See Also:
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: 1467340
Environment:
Last Closed: 2017-08-31 13:00:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 2 Michal Minar 2017-07-18 07:25:22 EDT
PR merged.
Comment 4 Michal Minar 2017-07-19 04:37:28 EDT
So it looks like the OCP builds have the binary under /usr/bin.
Could you try the prune command once again with a slight modification:

  pod="$(oc -n default get pods -l deploymentconfig=docker-registry \
        -o jsonpath=$'{.items[0].metadata.name}\n')"
  oc -n default exec -i -t "${pod}" -- /usr/bin/dockerregistry -prune=delete

?
Comment 5 ge liu 2017-07-19 05:32:09 EDT
@miminar, it works well now, the extended steps also passed, and pls update the doc above for it if necessary, thx

the registry read-only set,unset works well and run the hard prune successfully:

# pod="$(oc -n default get pods -l deploymentconfig=docker-registry \
>         -o jsonpath=$'{.items[0].metadata.name}\n')"

[root@qe-geliu-34master-registry-router-nfs-1 ~]# oc -n default exec -i -t "${pod}" -- /usr/bin/dockerregistry -prune=check

WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_PORT 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_PORT_9000_TCP 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_PORT_9000_TCP_ADDR 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_PORT_9000_TCP_PORT 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_PORT_9000_TCP_PROTO 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_SERVICE_HOST 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_SERVICE_PORT 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_SERVICE_PORT_REGISTRY_CONSOLE 
Would delete 11 blobs
Would free up 3.028 MiB of disk space
Use -prune=delete to actually delete the data

[root@qe-geliu-34master-registry-router-nfs-1 ~]# oc -n default exec -i -t "${pod}" -- /usr/bin/dockerregistry -prune=delete
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_PORT 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_PORT_9000_TCP 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_PORT_9000_TCP_ADDR 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_PORT_9000_TCP_PORT 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_PORT_9000_TCP_PROTO 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_SERVICE_HOST 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_SERVICE_PORT 
WARN[0000] Ignoring unrecognized environment variable REGISTRY_CONSOLE_SERVICE_PORT_REGISTRY_CONSOLE 
Deleted 11 blobs
Freed up 3.028 MiB of disk space
Comment 7 errata-xmlrpc 2017-08-31 13:00:23 EDT
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:1828

Note You need to log in before you can comment on or make changes to this bug.