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

Requesting GA maven-metadata.xml checks all GAVs under the repository

    Details

    • Story Points:
      2
    • Sprint:
      NXRM Immortals Sprint 30
    • Notability:
      2
    • InvestmentLayer:
      customer-driven
    • Aha Concept:
      non-concept

      Description

      SYMPTOM:

      Might be same root cause as NEXUS-28910 which was for OrientDB, but accessing a GA maven-metadata.xml becomes slower if there are many artifacts and versions under same group.

      REPRODUCE STEPS:

      1. Install NXRM 3.38 with PostgreSQL
      2. Create "maven-hosted" repository
      3. Create "org.sonatype.nexus.content.maven.store.Maven2ComponentDAO=DEBUG" logging
      4. Create 3 artifacts and 5 versions in one group (eg: ./61106_repro.sh 3)
      5. Delete one version from one GA
      6. Download the maven-metadata.xml of above GA
      7. Delete all components from "maven-hosted" repository
      8. Create 12 artifacts and 5 versions in one group (eg: ./61106_repro.sh 12)
      9. Delete one version from one GA
      10. Download the maven-metadata.xml of above GA

      EXPECTED BEHAVIOUR:

      Number of the executed SQL statements should be very similar between 3 artifacts and 12 artifacts as the requested maven-metadata.xml is GA level.

      ACTUAL BEHAVIOUR:

      With 3 artifacts and 5 versions:

      $ rg '==>  Preparing:.+' -o extract_threadId_from_nexus_3A5V.log | sort | uniq -c | sort -nr | head -n3
        14 ==>  Preparing: SELECT * FROM maven2_component WHERE repository_id = ? AND namespace = ? AND name = ? AND version = ? ;
        14 ==>  Preparing: SELECT * FROM maven2_component WHERE repository_id = ? AND component_id > ? AND (namespace = ? AND name = ? AND (base_version = ? OR version = ?)) ORDER BY component_id LIMIT ?;
        14 ==>  Preparing: SELECT * FROM maven2_component WHERE repository_id = ? AND (namespace = ? AND name = ? AND (base_version = ? OR version = ?)) ORDER BY component_id LIMIT ?;
      

      With 12 artifacts and 5 versions:

      $ rg '==>  Preparing:.+' -o extract_threadId_from_nexus_12A5G.log | sort | uniq -c | sort -nr | head -n3
        59 ==>  Preparing: SELECT * FROM maven2_component WHERE repository_id = ? AND namespace = ? AND name = ? AND version = ? ;
        59 ==>  Preparing: SELECT * FROM maven2_component WHERE repository_id = ? AND component_id > ? AND (namespace = ? AND name = ? AND (base_version = ? OR version = ?)) ORDER BY component_id LIMIT ?;
        59 ==>  Preparing: SELECT * FROM maven2_component WHERE repository_id = ? AND (namespace = ? AND name = ? AND (base_version = ? OR version = ?)) ORDER BY component_id LIMIT ?;
      

      It seems currently DatastoreMetadataRebuilder.DatastoreWorker#browseGAVs() is always executed by the rebuildMetadata(), so that, similar to NEXUS-28910, it checks all GAVs under same group repository.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mpiggott Matthew Piggott
              Reporter:
              hosako Hajime Osako
              Last Updated By:
              Michael Prescott Michael Prescott
              Team:
              NXRM - Optimus
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title