This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-39e3f40a-68d0-4488-ad5d-0f53a140c8c1 XWIKI-25794 Open

Viewing an old revision of an extension page lists the dependencies of all its versions and runs one query per dependency

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-13c1ca7b-115e-4b53-a46c-7ded575b36b3 Michael Hamann created this issue on 18/Nov/26 12:39
 
Summary: Viewing an old revision of an extension page lists the dependencies of all its versions and runs one query per dependency
Issue Type: cid:jira-generated-image-avatar-39e3f40a-68d0-4488-ad5d-0f53a140c8c1 Bug
Affects Versions: 17.9.0
Assignee: Unassigned
Components: Repository
Created: 18/Nov/26 12:39
Labels: performance
Priority: cid:jira-generated-image-static-major-c93f343e-533e-41fe-986e-0744224f3b55 Major
Reporter: Michael Hamann
Description:

Viewing an old revision of an extension page on an extension repository (e.g. /xwiki/bin/viewrev/Extension/Wiki%20Application?rev=91.1 on extensions.xwiki.org) can take minutes and run more than a thousand database queries.

Steps to reproduce

  1. On an extension repository, take an extension page with many versions in its history, whose old revisions still hold the version and dependency objects (stored on the extension page before XWIKI-14136).
  2. View an old revision whose lastVersion is no longer available in the current version storage of the extension.

Expected

The "Dependencies" section lists the dependencies of the revision's last version, with one lookup per dependency.

Actual

The "Dependencies" section lists the dependencies of all versions stored in the revision, and the sheet runs one query per listed dependency. On extensions.xwiki.org, revision 91.1 of Extension.Wiki Application holds 1,282 dependency objects (130 versions): the request ran 1,282 dependency lookup queries, each in its own transaction, and took 108 seconds.

Cause

ExtensionCode.ExtensionSheet gets the last version object through $services.repository.getVersionObject(id, lastVersion), which reads the current extension and version documents, not the displayed revision. When that version can't be found there, $lastVersionObject is null and $doc.getObjects('ExtensionCode.ExtensionDependencyClass', 'extensionVersion', $lastVersionObject.getValue('version')) is called with a null value, for which Document#getObjects(String, String, String) returns all objects of the class.

 
 

2 updates

 
cid:jira-generated-image-avatar-13c1ca7b-115e-4b53-a46c-7ded575b36b3 Changes by Michael Hamann on 18/Nov/26 12:40
 
Fix Version: 18.10.0-rc-1
Assignee: Michael Hamann