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

    • 3
    • Yes
    • NXRM Immortals Sprint 44, NXRM Immortals Sprint 45
    • 2
    • non-concept
    • 2

    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
      1. Check how many properties files
        find ./sonatype-work/nexus3/blobs/default/content/vol-* -name '*.properties' | wc -l
      1. 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".


      Important Note:

      While the fix version of this issue is 3.43.0, the fix was incomplete for one specific circumstance outlined in NEXUS-36659 fixed in 3.44.0.

      Therefore all customers affected by maven-metadata.xml issues for group repositories should upgrade to 3.44.0 or newer.

       

      Attachments

        Issue Links

          Activity

            People

              jhill Joshua Hill
              hosako Hajime Osako
              Michael Oliverio Michael Oliverio
              NXRM - Optimus
              Joshua Hill Joshua Hill
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                tigCommentSecurity.panel-title