You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Simon McNaughton (Created) (JIRA)" <ji...@apache.org> on 2012/03/07 07:26:09 UTC

[jira] [Created] (JCR-3252) Inflated QueryResultsImpl getTotalSize Count

Inflated QueryResultsImpl getTotalSize Count
--------------------------------------------

                 Key: JCR-3252
                 URL: https://issues.apache.org/jira/browse/JCR-3252
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 2.1.6
            Reporter: Simon McNaughton
            Priority: Minor


The results of the method getTotalSize() in class org.apache.jackrabbit.core.query.lucene.QueryResultImpl appear to sometimes be inflated.

The method getTotalSize() returns the number of results of the query(numResults) minus the number of results that the accessManager has not allowed access to (invalid). The value of invalid appears to be determined during the method collectScoreNodes.

The issue is that 'invalid' doesn't appear to accurately reflect the total number of results of the orginal query that the user is not allowed access to, resulting in an incorrect value for getTotalSize().

The cause of this appears to be in method collectScoreNodes because it will only check nodes to see if they are invalid while it is looking for the first 'maxResultSize' valid nodes. Any nodes after that limit are not checked for validity. This may result in a number of nodes that are invalid, but have not recorded as such. Then because the limit variable doesn't reflect the actual number of invalid results, the getTotalSize() value is inflated.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3252) Inflated QueryResultsImpl getTotalSize Count

Posted by "Simon McNaughton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon McNaughton updated JCR-3252:
----------------------------------

    Affects Version/s:     (was: 2.1.6)
                       2.5.1
    
> Inflated QueryResultsImpl getTotalSize Count
> --------------------------------------------
>
>                 Key: JCR-3252
>                 URL: https://issues.apache.org/jira/browse/JCR-3252
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.5.1
>            Reporter: Simon McNaughton
>            Priority: Minor
>         Attachments: QueryResultImp_3252.patch
>
>
> The results of the method getTotalSize() in class org.apache.jackrabbit.core.query.lucene.QueryResultImpl appear to sometimes be inflated.
> The method getTotalSize() returns the number of results of the query(numResults) minus the number of results that the accessManager has not allowed access to (invalid). The value of invalid appears to be determined during the method collectScoreNodes.
> The issue is that 'invalid' doesn't appear to accurately reflect the total number of results of the orginal query that the user is not allowed access to, resulting in an incorrect value for getTotalSize().
> The cause of this appears to be in method collectScoreNodes because it will only check nodes to see if they are invalid while it is looking for the first 'maxResultSize' valid nodes. Any nodes after that limit are not checked for validity. This may result in a number of nodes that are invalid, but have not recorded as such. Then because the limit variable doesn't reflect the actual number of invalid results, the getTotalSize() value is inflated.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (JCR-3252) Inflated QueryResultsImpl getTotalSize Count

Posted by "Simon McNaughton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13430882#comment-13430882 ] 

Simon McNaughton edited comment on JCR-3252 at 8/8/12 5:41 AM:
---------------------------------------------------------------

Added Patch File.

Adds a variable totalSize, which maintains a count of all valid entries.

The getResults function is extended to continue checking the score nodes after maxResultSize nodes have been gathered. This is to continue scanning for nodes which the current session has access to.

This will result in the return value for getTotalSize to be accurate even if there are nodes in the result set for which the current session has no permission to access.
                
      was (Author: uqsmcnau):
    Adds a variable totalSize, which maintains a count of all valid entries.

The getResults function is extended to continue checking the score nodes after maxResultSize nodes have been gathered. This is to continue scanning for nodes which the current session has access to.

This will result in the return value for getTotalSize to be accurate even if there are nodes in the result set for which the current session has no permission to access.
                  
> Inflated QueryResultsImpl getTotalSize Count
> --------------------------------------------
>
>                 Key: JCR-3252
>                 URL: https://issues.apache.org/jira/browse/JCR-3252
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.1.6
>            Reporter: Simon McNaughton
>            Priority: Minor
>         Attachments: QueryResultImp_3252.patch
>
>
> The results of the method getTotalSize() in class org.apache.jackrabbit.core.query.lucene.QueryResultImpl appear to sometimes be inflated.
> The method getTotalSize() returns the number of results of the query(numResults) minus the number of results that the accessManager has not allowed access to (invalid). The value of invalid appears to be determined during the method collectScoreNodes.
> The issue is that 'invalid' doesn't appear to accurately reflect the total number of results of the orginal query that the user is not allowed access to, resulting in an incorrect value for getTotalSize().
> The cause of this appears to be in method collectScoreNodes because it will only check nodes to see if they are invalid while it is looking for the first 'maxResultSize' valid nodes. Any nodes after that limit are not checked for validity. This may result in a number of nodes that are invalid, but have not recorded as such. Then because the limit variable doesn't reflect the actual number of invalid results, the getTotalSize() value is inflated.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3252) Inflated QueryResultsImpl getTotalSize Count

Posted by "Simon McNaughton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon McNaughton updated JCR-3252:
----------------------------------

    Status: Patch Available  (was: Open)
    
> Inflated QueryResultsImpl getTotalSize Count
> --------------------------------------------
>
>                 Key: JCR-3252
>                 URL: https://issues.apache.org/jira/browse/JCR-3252
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.5.1
>            Reporter: Simon McNaughton
>            Priority: Minor
>         Attachments: QueryResultImp_3252.patch
>
>
> The results of the method getTotalSize() in class org.apache.jackrabbit.core.query.lucene.QueryResultImpl appear to sometimes be inflated.
> The method getTotalSize() returns the number of results of the query(numResults) minus the number of results that the accessManager has not allowed access to (invalid). The value of invalid appears to be determined during the method collectScoreNodes.
> The issue is that 'invalid' doesn't appear to accurately reflect the total number of results of the orginal query that the user is not allowed access to, resulting in an incorrect value for getTotalSize().
> The cause of this appears to be in method collectScoreNodes because it will only check nodes to see if they are invalid while it is looking for the first 'maxResultSize' valid nodes. Any nodes after that limit are not checked for validity. This may result in a number of nodes that are invalid, but have not recorded as such. Then because the limit variable doesn't reflect the actual number of invalid results, the getTotalSize() value is inflated.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JCR-3252) Inflated QueryResultsImpl getTotalSize Count

Posted by "Simon McNaughton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon McNaughton updated JCR-3252:
----------------------------------

    Attachment: QueryResultImp_3252.patch

Adds a variable totalSize, which maintains a count of all valid entries.

The getResults function is extended to continue checking the score nodes after maxResultSize nodes have been gathered. This is to continue scanning for nodes which the current session has access to.

This will result in the return value for getTotalSize to be accurate even if there are nodes in the result set for which the current session has no permission to access.
                
> Inflated QueryResultsImpl getTotalSize Count
> --------------------------------------------
>
>                 Key: JCR-3252
>                 URL: https://issues.apache.org/jira/browse/JCR-3252
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.1.6
>            Reporter: Simon McNaughton
>            Priority: Minor
>         Attachments: QueryResultImp_3252.patch
>
>
> The results of the method getTotalSize() in class org.apache.jackrabbit.core.query.lucene.QueryResultImpl appear to sometimes be inflated.
> The method getTotalSize() returns the number of results of the query(numResults) minus the number of results that the accessManager has not allowed access to (invalid). The value of invalid appears to be determined during the method collectScoreNodes.
> The issue is that 'invalid' doesn't appear to accurately reflect the total number of results of the orginal query that the user is not allowed access to, resulting in an incorrect value for getTotalSize().
> The cause of this appears to be in method collectScoreNodes because it will only check nodes to see if they are invalid while it is looking for the first 'maxResultSize' valid nodes. Any nodes after that limit are not checked for validity. This may result in a number of nodes that are invalid, but have not recorded as such. Then because the limit variable doesn't reflect the actual number of invalid results, the getTotalSize() value is inflated.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira