Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-34565

REGISTRY_STORAGE_S3_CHUNKSIZE is set to a negative number when chunkSizeMiB is greater and equal 2048, samller and equal 4096

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Critical
    • No
    • None
    • None
    • Rejected
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      when chunkSizeMiB is greater than or equal to 2048, samller than or equal to 4096,REGISTRY_STORAGE_S3_CHUNKSIZE is set to a negative number, then image registry pod go to panic.
      When chunkSizeMiB is greater than 4096 and less than 5120, the vaule of REGISTRY_STORAGE_S3_CHUNKSIZE is set to smaller than the actual value.

      Version-Release number of selected component (if applicable):

          https://github.com/openshift/cluster-image-registry-operator/pull/1026

      How reproducible:

          always

      Steps to Reproduce:

          1.Enable TP for chunkSizeMiB
          2.set spec.storage.s3.chunkSizeMiB to 2048 in config.image/cluster CRD
      % oc get config.image/cluster -o jsonpath='{..storage}' | jq -r
      {
        "managementState": "Managed",
        "s3": {
          "bucket": "wxjchk29a-zl98h-image-registry-us-east-2-hwokxugmyyfwuhqijvyeb",
          "chunkSizeMiB": 2048,
          "encrypt": true,
          "region": "us-east-2",
          "trustedCA": {
            "name": ""
          },
          "virtualHostedStyle": false
        }
      }
      {
        "managementState": "Managed",
        "s3": {
          "bucket": "wxjchk29a-zl98h-image-registry-us-east-2-hwokxugmyyfwuhqijvyeb",
          "chunkSizeMiB": 2048,
          "encrypt": true,
          "region": "us-east-2",
          "trustedCA": {
            "name": ""
          },
          "virtualHostedStyle": false
        }
      }    
          3.Check the env of deploy/image-regsitry under openshift-image-registry namespace 
          
      %oc set env deploy/image-registry --list
      # deployments/image-registry, container registry
      REGISTRY_STORAGE_S3_CHUNKSIZE=-2147483648
      ===snip===
      %oc get pods -l docker-registry=default -n openshift-image-registry
      NAME                              READY   STATUS             RESTARTS      AGE
      image-registry-6454445c59-n85v9   0/1     CrashLoopBackOff   4 (15s ago)   107s
      image-registry-6454445c59-vvdvc   0/1     CrashLoopBackOff   3 (35s ago)   107s
      image-registry-67dff68c48-2qs7l   1/1     Running            0             24m
      
      % oc logs -f image-registry-6454445c59-n85v9time="2024-05-29T06:52:24.874994977Z" level=info msg="start registry" distribution_version=v3.0.0+unknown go.version="go1.21.9 (Red Hat 1.21.9-1.el9_4) X:strictfipsruntime" openshift_version=v3.11.0+4462ddc-389-dirtytime="2024-05-29T06:52:24.875226956Z" level=info msg="caching project quota objects with TTL 1m0s" go.version="go1.21.9 (Red Hat 1.21.9-1.el9_4) X:strictfipsruntime"panic: the chunksize -2147483648 parameter should be a number between 5242880 and 5368709120 (inclusive)
      goroutine 1 [running]:github.com/distribution/distribution/v3/registry/handlers.NewApp({0x2891e68?, 0x3ac54c0?}, 0xc000639800)	/go/src/github.com/openshift/image-registry/vendor/github.com/distribution/distribution/v3/registry/handlers/app.go:130 +0x2a65github.com/openshift/image-registry/pkg/dockerregistry/server/supermiddleware.NewApp({0x2891e68, 0x3ac54c0}, 0x0?, {0x2893c30?, 0xc0005d54d0})	/go/src/github.com/openshift/image-registry/pkg/dockerregistry/server/supermiddleware/app.go:96 +0xb3github.com/openshift/image-registry/pkg/dockerregistry/server.NewApp({0x2891e68?, 0x3ac54c0}, {0x287a150?, 0xc000587a00}, 0xc000639800, 0xc00058a0a0, {0x0?, 0x0})	/go/src/github.com/openshift/image-registry/pkg/dockerregistry/server/app.go:138 +0x467github.com/openshift/image-registry/pkg/cmd/dockerregistry.NewServer({0x2891e68, 0x3ac54c0}, 0xc000639800, 0xc00058a0a0)	/go/src/github.com/openshift/image-registry/pkg/cmd/dockerregistry/dockerregistry.go:212 +0x368github.com/openshift/image-registry/pkg/cmd/dockerregistry.Execute({0x286fbc0, 0xc000587880})	/go/src/github.com/openshift/image-registry/pkg/cmd/dockerregistry/dockerregistry.go:166 +0x832main.main()	/go/src/github.com/openshift/image-registry/cmd/dockerregistry/main.go:93 +0x48b
      
      4. set spec.storage.s3.chunkSizeMiB to 4096 in config.image/cluster CRD
      % oc set env deploy/image-registry --list
      # deployments/image-registry, container registry
      REGISTRY_STORAGE_S3_CHUNKSIZE=0
      
      5. set spec.storage.s3.chunkSizeMiB to 5000 in config.image/cluster CRD
      % oc set env deploy/image-registry --list
      # deployments/image-registry, container registry
      REGISTRY_STORAGE_S3_CHUNKSIZE=947912704

      Actual results:

      REGISTRY_STORAGE_S3_CHUNKSIZE is not set correct.    

      Expected results:

          When chunkSizeMiB is greater than or equal to 5, less than or equal to 5120, the REGISTRY_STORAGE_S3_CHUNKSIZE should be set to chunkSizeMiB * 1024 * 1024

      Additional info:

          When chunkSizeMiB is greater than or equal to 5, less than 2048, REGISTRY_STORAGE_S3_CHUNKSIZE set to chunkSizeMiB * 1024 * 1024, correct.

              rh-ee-dmistry Deep Mistry
              rh-ee-xiuwang XiuJuan Wang
              None
              None
              XiuJuan Wang XiuJuan Wang
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: