Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.35.0, 3.37.3
-
Fix Version/s: 3.38.0
-
Component/s: Database PostgreSQL, Maven
-
Labels:
-
Story Points:2
-
Notability:2
Description
SYMPTOM:
Since migrated to PostgreSQL, accessing /repository/maven-releases/com/example/my-app/maven-metadata.xml after the scheduled Cleanup task takes longer time.
REPRODUCE STEPS:
- Install 3.35 and migrate to PostgreSQL
- Enable DEBUG logging for "org.sonatype.nexus.content.maven.store.Maven2ComponentDAO"
- Deploy a maven artifact with 2 versions into the maven-releases repository
- Delete one version from Browse page
- With curl command, request maven-metadata.xml (should be quick), for example:
time curl -sf -D- -u admin:admin123 -O http://localhost:8081/repository/maven-releases/com/example/my-app/maven-metadata.xml
- Deploy a maven artifact with 101 versions
- Delete one version from Browse page
- With curl command, request maven-metadata.xml again
EXPECTED BEHAVIOUR:
The number of SQL SELECT statements should be proportional to the number of components or assets (blobs)
ACTUAL BEHAVIOUR:
One particular query looks like executed close to the number of comps multiplied by the number of comps, which is from org.sonatype.nexus.repository.content.fluent.internal.FluentComponentBuilderImpl#findComponent:
grep -E '==> Preparing:.+' -o extract_threadId_from_nexus.log | sort | uniq -c
When 100 components (versions):
... (snip) ... 10500 ==> Preparing: SELECT * FROM maven2_component WHERE repository_id = ? AND namespace = ? AND name = ? AND version = ? ;
With 200 components:
40600 ==> Preparing: SELECT * FROM maven2_component WHERE repository_id = ? AND namespace = ? AND name = ? AND version = ? ;
Even though above query uses the correct index and each query should be very fast (expecting a few ms), if PostgreSQL side had some slight slowness (including the connection between Nexus and PG), above can potentially cause significant slowness.
Attachments
Issue Links
- relates
-
NEXUS-28910 Staging move operations for Maven rebuilds maven metadata for unrelated components resulting in extremely slow operations
-
- Closed
-