Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-35530

Maven REPOSITORY_METADATA type asset is always created by accessing it via group repo

    Details

    • Story Points:
      3
    • Release Note:
      Yes
    • Sprint:
      NXRM Immortals Sprint 44, NXRM Immortals Sprint 45
    • Notability:
      2
    • InvestmentLayer:
      support-escalated
    • Aha Concept:
      non-concept

      Description

      ISSUE:

      Accessing maven-metadata.xml via Maven group repository generates a new blob even no change in the group members.
      This means any "mvn" command may generate unnecessary blob files.
      These unnecessary blobs could contribute to the slowness of "Cleanup unused asset blobs" task and "Reconcile component database from blob store" task.

      REPRODUCE STEPS:

      1. Install NXRM 3.42.0 with H2 or PostgreSQL
      2. Create maven-proxy (https://repo1.maven.org/maven2/) with Maximum metadata age = 1440 (default), maven-hosted, and maven-group repositories, with default settings
      3. Accessing some maven-metadata.xml via maven-group, for example:
        curl -I http://localhost:8081/repository/maven-group/junit/junit/maven-metadata.xml
      4. Check how many properties files
        find ./sonatype-work/nexus3/blobs/default/content/vol-* -name '*.properties' | wc -l
      5. Repeat the curl and find commands

      EXPECTED BEHAVIOUR:

      As Maximum metadata age = 1440 and no assets are added in maven-proxy and maven-hosted, the "find ... | wc -l" command should return same number.

      ACTUAL BEHAVIOUR:

      Executing one "curl" command increases 5 "*.properties" files.

      POTENTIAL CAUSE:

      Please check "MavenContentGroupFacetImpl#cache" as it seems this method always calls "FluentAsset::markAsStale", which may make attributes.cache.cache_token = "invalidated".

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jhill Joshua Hill
              Reporter:
              hosako Hajime Osako
              Last Updated By:
              Rich Seddon Rich Seddon
              Team:
              NXRM - Optimus
              Owner:
              Joshua Hill Joshua Hill
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title