You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Julian Reschke (Jira)" <ji...@apache.org> on 2024/07/24 04:53:00 UTC

[jira] [Resolved] (SLING-12384) ResourceResolver: paged query for sling:alias will miss entries

     [ https://issues.apache.org/jira/browse/SLING-12384?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke resolved SLING-12384.
------------------------------------
    Resolution: Fixed

> ResourceResolver: paged query for sling:alias will miss entries
> ---------------------------------------------------------------
>
>                 Key: SLING-12384
>                 URL: https://issues.apache.org/jira/browse/SLING-12384
>             Project: Sling
>          Issue Type: Bug
>    Affects Versions: Resource Resolver 1.11.6
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Major
>             Fix For: Resource Resolver 1.12.0
>
>
> Initially I thought that the issue just applies to empty alias values, because the paged query will always skip them, due to the first query being "{{{}first(sling:alias) > ''{}}}".
> Closer inspection showed that the pageing logic was flawed:
>  * read values until pageSize is exceeded *and* a new key value _x_ is reached
>  * start a new query with condition {{> x}}
> This worked mostly ok with vanity paths, where the search key "first(sling:vanityPath)" almost always changes (having the same value for many resources will only lead to one working vanity path, because the same path cannot map to multiple resources).
> For aliases the situations is different, because their value is locally scoped to the collection the aliased resource appears in. So we could have 10000 resources with the _same_ set of aliases (think translations or shortcuts), and in cases like these, the page size (right now 2000) would be exceeded.
> The proposed change is:
>  * always use ">=" so the initial page contains the empty-valued properties as well
>  * when page size is exceeded and a new key _y_ is found, do not include the last result, but execute a new query right away (with the proper condition so that all resources with "{{first(sling:alias) >= y}}" are returned)
>  * also add more diagnostics, which may help to diagnose pacge size / query limit issues early
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)