You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Honwai Wong (JIRA)" <ji...@apache.org> on 2011/04/18 19:48:05 UTC

[jira] [Created] (JCR-2950) Performance bottleneck: cache of CachingEntryCollector ineffective in case many ACEs are present

Performance bottleneck: cache of CachingEntryCollector ineffective in case many ACEs are present
------------------------------------------------------------------------------------------------

                 Key: JCR-2950
                 URL: https://issues.apache.org/jira/browse/JCR-2950
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
          Components: jackrabbit-core, security
    Affects Versions: 2.2.4
         Environment: Repository with ACEs > 1000
            Reporter: Honwai Wong


The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.

Java callstack:
at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke edited comment on JCR-2950 at 7/26/12 4:40 PM:
--------------------------------------------------------------

Test results with the tests only reading *nodes*; it appears this is significantly cheaper than reading 20% nodes and 80% properties.
                
      was (Author: reschke):
    Test results with scroot caching the root node even when not access controlled.
                  
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: Julian Reschke
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, auth-prefilled-cache.csv, cache-empty-aces-scfixed.csv, cache-empty-aces.csv, cache-empty-aces.png, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, syssessioncomparison.csv, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela edited comment on JCR-2950 at 6/13/12 7:54 AM:
------------------------------------------------------

that change now looks pretty awkward to me... now that the updateCache isn't used within the sync block any more
i think we should change to code and start looking from the parent node. that would IMO make the nodeIdToBeUpdated
field and the assertion redundant and keep the code clear.

something like:

NodeID nextID = null;
if (!rootID.equals(node.getID()) {
      Node n = node.getParent();
      // and then proceed with the unmodified search for the next access controlled ancestor in the hierarchy
      while() { 
      }
}

or maybe even adding a shortcut to avoid accessing the parent node if there was already an cache for the node.getParentID().
but in any case starting directly with the ancestor.


                
      was (Author: anchela):
    that change now looks pretty awkward to me... now that the updateCache isn't used within the sync block any more
i think we should change to code and start looking from the parent node. that would IMO make the nodeIdToBeUpdated
field and the assertion redundant and keep the code clear.

something like:

NodeID nextID = null;
if (!rootID.equals(node.getID()) {
      Node n = n.getParent();
      // and then proceed with the unmodified search for the next access controlled ancestor in the hierarchy
      while() { 
      }
}


                  
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-refactor+rootnode.patch

...and here's a variant that special-cases the root node.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela updated JCR-2950:
------------------------

    Attachment: JCR-2950-refactor+rootnode_6.patch

- simplified updateCache method
- extracted getNextID
- extracted isRootID(NodeID) as we now use that check for shortcuts in various places.

tests passed except for the 2 mentioned above.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

Ok, I just got

-------------------------------------------------------------------------------
Test set: org.apache.jackrabbit.core.security.authorization.acl.TestAll
-------------------------------------------------------------------------------
Tests run: 157, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 12.355 sec <<< FAILURE!
testCacheUnderLoad(org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest)  Time elapsed: 0.172 sec  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<1> but was:<0>
	at junit.framework.Assert.fail(Assert.java:50)
	at junit.framework.Assert.failNotEquals(Assert.java:287)
	at junit.framework.Assert.assertEquals(Assert.java:67)
	at junit.framework.Assert.assertEquals(Assert.java:199)
	at junit.framework.Assert.assertEquals(Assert.java:205)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.verifyACEs(EntryCollectorTest.java:159)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.testCache(EntryCollectorTest.java:197)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest$1.runTest(EntryCollectorTest.java:401)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.runTestUnderLoad(EntryCollectorTest.java:384)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.testCacheUnderLoad(EntryCollectorTest.java:399)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at org.apache.jackrabbit.test.ConcurrentTestSuite.access$001(ConcurrentTestSuite.java:29)
	at org.apache.jackrabbit.test.ConcurrentTestSuite$2.run(ConcurrentTestSuite.java:67)
	at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:662)

with the patch in place. This seems to apply that in presence of the patch, the invalidation of the ACL cache might not work correctly when there are concurrent read operations.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela updated JCR-2950:
------------------------

    Attachment: JCR-2950_performance_tests.patch.gz

two performance tests that read randomly a given number of items from a deep tree that contains >100000 items and accessed controlled nodes on various levels.
a) 1 session
b) concurrent reads

note: the patch does not add the tests to the list in the AbstractPerformanceTest because the setup takes rather long.

i used these test for profiling and performance measurements during the last couple of days.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_performance_tests.patch.gz
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela edited comment on JCR-2950 at 7/18/12 9:07 AM:
------------------------------------------------------

> Can we share the session pool with CompiledPermissionImpl? 

imo that would make sense... but given the hacks that were required in order to create the session pool 
within the entry collector, i would suggest that we introduce the pool in a very early state and prevent
exposing the SystemSession and it's creation to the public: for example while creating the 
AccessControlProviderFactoryImpl in DefaultSecurityManager.... e.g. passing a session provider instead
of a single session.

in any case i would like to keep that separate from my entryseparation patch as it get rather cumbersome
to sort out changes when the patch gets too big. julian, what do you think?


                
      was (Author: anchela):
    > Can we share the session pool with CompiledPermissionImpl? 

imo that would make sense... but given the hacks that were required in order to create the session pool 
within the entry collector, i would suggest that we introduce the pool in a very early state and prevent
exposing the SystemSession and it's creating to the public: for example while creating the 
AccessControlProviderFactoryImpl in DefaultSecurityManager.... e.g. passing a session provider instead
of a single session.

in any case i would like to keep that separate from my entryseparation patch as it get rather cumbersome
to sort out changes when the patch gets too big. julian, what do you think?


                  
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Alex Parvulescu updated JCR-2950:
---------------------------------

    Attachment: CachingEntryCollector.ConcurrentCache-trunk.patch

patch to replace GrowingLRUMap by a ConcurrentCache.
This should provide better concurrency, but I'm not sure if the cache eviction policy works the same way as the LRU map.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Marcel Reutegger commented on JCR-2950:
---------------------------------------

Tested the patch with the pool of system sessions as well and the numbers are quite promising. my best cases were around 7 seconds per test iterations. I saw a lot of threads reading from the derby data base and then tested again with a bundleCacheSize of 128 (MB). This again reduced the test iteration time to roughly 5 seconds. The bottleneck now moved to the shared session in CompiledPermissionImpl:

"Thread-110" prio=10 tid=0x00007f57f924b800 nid=0x4d81 waiting for monitor entry [0x00007f57fc2dd000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:622)
	- waiting to lock <0x00000000e09c8330> (a org.apache.jackrabbit.core.ItemManager)
	at org.apache.jackrabbit.core.security.authorization.acl.CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:241)
	- locked <0x00000000e842e130> (a java.lang.Object)
	at org.apache.jackrabbit.core.security.DefaultAccessManager.canRead(DefaultAccessManager.java:265)
	at org.apache.jackrabbit.core.ItemManager.canRead(ItemManager.java:438)
	at org.apache.jackrabbit.core.ItemManager.createItemData(ItemManager.java:843)
	at org.apache.jackrabbit.core.ItemManager.getItemData(ItemManager.java:391)
	at org.apache.jackrabbit.core.ItemManager.itemExists(ItemManager.java:304)
	at org.apache.jackrabbit.core.ItemManager.itemExists(ItemManager.java:476)
	at org.apache.jackrabbit.core.session.SessionItemOperation$1.perform(SessionItemOperation.java:49)
	at org.apache.jackrabbit.core.session.SessionItemOperation$1.perform(SessionItemOperation.java:46)
	at org.apache.jackrabbit.core.session.SessionItemOperation.perform(SessionItemOperation.java:187)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
	at org.apache.jackrabbit.core.SessionImpl.perform(SessionImpl.java:361)
	at org.apache.jackrabbit.core.SessionImpl.itemExists(SessionImpl.java:803)
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: auth-prefilled-cache.csv

Test results with a prefilled cache of 20000 entries
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: Julian Reschke
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, auth-prefilled-cache.csv, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, syssessioncomparison.csv, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-refactor+rootnode_4.patch

This fixes the assert and augments the test cases.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela edited comment on JCR-2950 at 6/13/12 2:43 PM:
------------------------------------------------------

julian, while trying to improve the updateCache method i found that some of the test-cases fail from time to time:

- testPermissionsUnderLoad (at line 307)
- testCacheUnderLoad (at line 159)

this not only occured in my modified patch but also in the latest JCR-2950-refactor+rootnode_5.patch.
debugging testPermissionsUnderLoad revealed that in case of failure there is an empty ACL present at 'path'. this might not
necessarily indicate a problem with the refactoring... but still...


                
      was (Author: anchela):
    julian, while trying to improve the updateCache method i found that some of the test-cases fail from time to time:

- testPermissionsUnderLoad (at line 307)
- testCacheUnderLoad (at line 159)

this not only occured in my modified patch but also in the latest JCR-2950-refactor+rootnode_5.patch.
debugging the first one revealed that in case of failure there is an empty ACL present at 'path'. this might not
necessarily indicate a problem with the refactoring... but still...


                  
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

running the ConcurrentReadAccessControlledTreeTest on jackrabbit 2.4 again was similar to 'S' and 'P' variant.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_performance_tests.patch.gz
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: jcr-2950-csv.sh

script for conversion to CSV
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh, jcr-2950.csv, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: jcr-2950-csv.sh
                jcr-2950.png
                jcr-2950.csv
                test2950.sh

Updated test script (now running 2.4 with different cache sizes), updated results from 5 test executions.

The test machine is an ancient Quad Core machine; the 8 results per tests are the best ones measured.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment:     (was: JCR-2950-throttle.patch)
    
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

ok... so i would suggest that we don't start changing yet another part....

i did run the ConcurrentReadAccessControlledTreeTest performance test that should provide some results for
situations where the entry-cache limit is reached with JCR-3352 included and with the 3 different cache update variants.

i get the impression that overall performance was similar in case of synchronized and parallel access.
the throttled update looks to be slightly slower on average (but that necessarily doesn't mean too much and i am not
convinced that the difference is really significant). what strikes me however is, that with the 'T' strategy the performance
test seems to be stalling at some point.... but i have to check that one more time... what also strikes me is that
the number of ms to read 10000 random items seems to vary much more in the 'T' case (all completed cycles are
reported with system output even those from the warm-up phase).

in order to get a better feeling for that i added a shortcut in the beginning of the "throttledUpdateCache" method that
prevent entering the concurrent map in case the target node is not access controllable... but from the pure figures
this didn't seem to have an effect.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_performance_tests.patch.gz
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

Maybe this is a simple timing issue? The cache gets invalidated based on an observation event, right? That would explain why there's a small time window during which the code that initiated the ACE change may not see it.

                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-refactor+rootnode_5.patch

Moves/changes the assert to a runtime check in the case (throws IllegalArgumentException)
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

See <https://issues.apache.org/jira/secure/attachment/12535096/jcr-2950.png>, where

- "2.4" is the test result for Jackrabbit 2.4-SNAPSHOT
- "2.6-{cachesize}-{strategy}-{cacheNoAcl}-{specialCaseRoot} is the result for 2.6-SNAPSHOT with the given parameters
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

that change now looks pretty awkward to me... now that the updateCache isn't used within the sync block any more
i think we should change to code and start looking from the parent node. that would IMO make the nodeIdToBeUpdated
field and the assertion redundant and keep the code clear.

something like:

NodeID nextID = null;
if (!rootID.equals(node.getID()) {
      Node n = n.getParent();
      // and then proceed with the unmodified search for the next access controlled ancestor in the hierarchy
      while() { 
      }
}


                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-concurrent-cache-2.patch

JCR-2950-concurrent-cache.patch updated for current trunk.

I tried this with ConcurrentReadAccessControlledTreeTest and it doesn't appear to have a measurable effect.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_performance_tests.patch.gz
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela updated JCR-2950:
------------------------

    Attachment: JCR-2950-futures_2.patch

same as futures.patch with some re-ordering and indention fix
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

julian, while trying to improve the updateCache method i found that some of the test-cases fail from time to time:

- testPermissionsUnderLoad (at line 307)
- testCacheUnderLoad (at line 159)

this not only occured in my modified patch but also in the latest JCR-2950-refactor+rootnode_5.patch.
debugging the first one revealed that in case of failure there is an empty ACL present at 'path'. this might not
necessarily indicate a problem with the refactoring... but still...


                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-throttle2.patch

A variant that tries to avoid overlapping updates for the same nodeId altogether
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

> Can we share the session pool with CompiledPermissionImpl? 

imo that would make sense... but given the hacks that were required in order to create the session pool 
within the entry collector, i would suggest that we introduce the pool in a very early state and prevent
exposing the SystemSession and it's creating to the public: for example while creating the 
AccessControlProviderFactoryImpl in DefaultSecurityManager.... e.g. passing a session provider instead
of a single session.

in any case i would like to keep that separate from my entryseparation patch as it get rather cumbersome
to sort out changes when the patch gets too big. julian, what do you think?


                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment:     (was: test2950.sh)
    
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-throttle.patch

for testing purposes: a variant that attempts to limit the number of concurrently running updates 
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela edited comment on JCR-2950 at 6/12/12 7:57 AM:
------------------------------------------------------

yes, that makes sense... i would at least keep the ac entries for the root node separate.
additional CQ specific candidates that are for sure accessed with maximal frequency are
the content root and the user root.
                
      was (Author: anchela):
    yes, that makes sense.
                  
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

> julian, while trying to improve the updateCache method i found that some of the test-cases fail from time to time:
>
> - testPermissionsUnderLoad (at line 307)
> - testCacheUnderLoad (at line 159) 

I can't reproduce those, but I just saw another one fail (non-reproducably); how do we proceed? Are the original tests supposed to pass even with a background load? In that case, we need to investigate.


                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: jcr-2950-2.csv
                jcr-2950-2.png

test results for maxsize=5000 (default), but including the Angela's restructuring and the hack using 8 system sessions
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-futures.patch

a variant that attempts to put all subsequent update operations for the same nodeId into a wait state
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-futures.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

Can we share the session pool with CompiledPermissionImpl?
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Assigned] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke reassigned JCR-2950:
-----------------------------------

    Assignee: Julian Reschke  (was: angela)
    
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: Julian Reschke
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

WARNING: the test script was broken with respect to the noCacheAcl parameter, so previous test results related to that one need to ignored.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: Julian Reschke
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, auth-prefilled-cache.csv, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, syssessioncomparison.csv, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela updated JCR-2950:
------------------------

    Summary: CachingEntryCollector ineffective if number of accessed policies exceeds cache size  (was: Performance bottleneck: cache of CachingEntryCollector ineffective in case many ACEs are present)

> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

another way to address this issue specifically for CQ was to fix JCR-2782 as we currently have to create separate ACL nodes for every single user.

> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

r1353495 replaces the "fully parallel" update handling by code that attempts to throttle by nodeId; fully parallel and fully synchronized modes are configurable through a system property (that we probably want to remove once we are sure what's best)
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_performance_tests.patch.gz
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

I believe we have a remaining issue in updateCache (which previously was synchronized):

{code}
    private Entries updateCache(NodeImpl node) throws RepositoryException {
        Entries entries = super.getEntries(node);
        if (!entries.isEmpty()) {
            // find the next access control ancestor in the hierarchy
            // 'null' indicates that there is no ac-controlled ancestor.
            NodeId nextId = null;
            NodeImpl n = node;
            while (nextId == null && !rootID.equals(n.getNodeId())) {
                if (cache.containsKey(n.getNodeId())) {
                    nextId = n.getNodeId();
                } else if (cache.containsKey(n.getParentId())) {
                    nextId = n.getParentId();
                } else {
                    n = (NodeImpl) n.getParent();
                    if (hasEntries(n)) {
                        nextId = n.getNodeId();
                    } // else: not access controlled -> test next ancestors
                }
            }

            // adjust the 'nextId' to point to the next access controlled
            // ancestor node instead of the parent and remember the entries.
            entries.setNextId(nextId);
            cache.put(node.getNodeId(), entries);
        } // else: not access controlled -> ignore.
        return entries;
    }
{code}

In here, if updateCache is done concurrently with the same node, we may end up finding a cache entry for the node in the cache, and then update the "nextid" to the node itself. I believe.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-throttle.patch

for testing purposes: a variant that attempts to limit the number of concurrently running updates
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment:     (was: jcr-2950-csv.sh)
    
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

> in any case i would like to keep that separate from my entryseparation patch as it get rather cumbersome
to sort out changes when the patch gets too big. julian, what do you think? 

Absolutely. Should we spin off a separate sub task? Should I take over while you look at the pooling issue?

                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: Julian Reschke
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-futures_4.patch

Revised version that simplifies the "FutureEntries" variant
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_performance_tests.patch.gz
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke edited comment on JCR-2950 at 6/15/12 12:32 PM:
---------------------------------------------------------------

Ok, I just got

-------------------------------------------------------------------------------
Test set: org.apache.jackrabbit.core.security.authorization.acl.TestAll
-------------------------------------------------------------------------------
Tests run: 157, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 12.355 sec <<< FAILURE!
testCacheUnderLoad(org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest)  Time elapsed: 0.172 sec  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<1> but was:<0>
	at junit.framework.Assert.fail(Assert.java:50)
	at junit.framework.Assert.failNotEquals(Assert.java:287)
	at junit.framework.Assert.assertEquals(Assert.java:67)
	at junit.framework.Assert.assertEquals(Assert.java:199)
	at junit.framework.Assert.assertEquals(Assert.java:205)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.verifyACEs(EntryCollectorTest.java:159)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.testCache(EntryCollectorTest.java:197)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest$1.runTest(EntryCollectorTest.java:401)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.runTestUnderLoad(EntryCollectorTest.java:384)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.testCacheUnderLoad(EntryCollectorTest.java:399)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at org.apache.jackrabbit.test.ConcurrentTestSuite.access$001(ConcurrentTestSuite.java:29)
	at org.apache.jackrabbit.test.ConcurrentTestSuite$2.run(ConcurrentTestSuite.java:67)
	at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:662)

with the patch in place. This seems to imply that in presence of the patch, the invalidation of the ACL cache might not work correctly when there are concurrent read operations.
                
      was (Author: reschke):
    Ok, I just got

-------------------------------------------------------------------------------
Test set: org.apache.jackrabbit.core.security.authorization.acl.TestAll
-------------------------------------------------------------------------------
Tests run: 157, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 12.355 sec <<< FAILURE!
testCacheUnderLoad(org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest)  Time elapsed: 0.172 sec  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<1> but was:<0>
	at junit.framework.Assert.fail(Assert.java:50)
	at junit.framework.Assert.failNotEquals(Assert.java:287)
	at junit.framework.Assert.assertEquals(Assert.java:67)
	at junit.framework.Assert.assertEquals(Assert.java:199)
	at junit.framework.Assert.assertEquals(Assert.java:205)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.verifyACEs(EntryCollectorTest.java:159)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.testCache(EntryCollectorTest.java:197)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest$1.runTest(EntryCollectorTest.java:401)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.runTestUnderLoad(EntryCollectorTest.java:384)
	at org.apache.jackrabbit.core.security.authorization.acl.EntryCollectorTest.testCacheUnderLoad(EntryCollectorTest.java:399)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at org.apache.jackrabbit.test.AbstractJCRTest.run(AbstractJCRTest.java:456)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at org.apache.jackrabbit.test.ConcurrentTestSuite.access$001(ConcurrentTestSuite.java:29)
	at org.apache.jackrabbit.test.ConcurrentTestSuite$2.run(ConcurrentTestSuite.java:67)
	at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:662)

with the patch in place. This seems to apply that in presence of the patch, the invalidation of the ACL cache might not work correctly when there are concurrent read operations.
                  
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: jcr-2950.csv

Test results as CSV
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh, jcr-2950.csv, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment:     (was: jcr-2950.csv)
    
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: cache-empty-aces-scfixed.csv

Test results with scroot caching the root node even when not access controlled.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: Julian Reschke
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, auth-prefilled-cache.csv, cache-empty-aces-scfixed.csv, cache-empty-aces.csv, cache-empty-aces.png, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, syssessioncomparison.csv, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

right... which brings us back to the original discussions we had years ago: we add some improvement here and there 
but we don't address the actual issue which IMO is that we need to read a lot of items in order to evaluate the permissions.
that might work to some extend but i think it's very limited...
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: Julian Reschke
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, syssessioncomparison.csv, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Assigned] (JCR-2950) Performance bottleneck: cache of CachingEntryCollector ineffective in case many ACEs are present

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

angela reassigned JCR-2950:
---------------------------

    Assignee: angela

> Performance bottleneck: cache of CachingEntryCollector ineffective in case many ACEs are present
> ------------------------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Affects Version/s:     (was: 2.2.4)
                       2.6
                       2.2.12
                       2.4.2
    
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: syssessioncomparison.csv

Tests comparing results given trunk and current test case with the results when the test case uses a system session instead of a non-system session (this only applies to the test thread, not the background threads). 

The result shows that there appears almost one order of magnitude; thus the overhead of having to evaluate ACLs is indeed big (not a big surprise, but confirms what we expected).
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: Julian Reschke
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, syssessioncomparison.csv, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-refactor.patch

This patch just refactors the code and reduces the amount of synchronization.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: test2950.sh

test script
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

Should we try to make the cache work concurrently? See <http://stackoverflow.com/questions/221525/how-would-you-implement-an-lru-cache-in-java-6> which has a few suggestions.

Also, partitioning into a set of caches may be an option (<http://stackoverflow.com/a/613495>)
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment:     (was: jcr-2950.png)
    
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) Performance bottleneck: cache of CachingEntryCollector ineffective in case many ACEs are present

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

angela commented on JCR-2950:
-----------------------------

btw: it's not the number of ACEs that matters but the number of frequently accessed policy (ACL) nodes.

> Performance bottleneck: cache of CachingEntryCollector ineffective in case many ACEs are present
> ------------------------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950_entryseparation-multisessionhack.patch

JCR-2950_entryseparation.patch hacked to use a pool of system sessions; this seems indeed to help; but we'll need systematic measures. (also, this was done by making lots of things public that shouldn't be; need a better way to obtain new systemSessions inside the EntryCollector)
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) Performance bottleneck: cache of CachingEntryCollector ineffective in case many ACEs are present

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

angela commented on JCR-2950:
-----------------------------

this issue can only be fixed by fundamental refactoring of the ac storage and evaluation mechanism that would render the cache superfluous (see JCR-2842 for some initial thoughts). increasing the cache size cannot be considered a fix of the generic problem that the cache will become ineffective with "many ACEs".


> Performance bottleneck: cache of CachingEntryCollector ineffective in case many ACEs are present
> ------------------------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Marcel Reutegger commented on JCR-2950:
---------------------------------------

Forgot to mention the 2.4 best case benchmark was 16 seconds on my test machine.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

yes, that makes sense.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela updated JCR-2950:
------------------------

    Attachment: JCR-2950_entryseparation.patch

yet another patch that will allow us to try further improvements later on: the patch adds complete separation of entries used for permission eval from ACEs exposed on the JCR API level. consequently i had to rewrite the retrieval of effective policies (that were using the entry collector as well). in addition i had to remove the EntryCollectorTest#testIsCached as they were relying on the effective policies actually exposing the entries in the cache. this is no longer the case for the reason above.

this patch most probably doesn't add a major performance gain itself, but it really reduces the entries stored in the cache to the information required for permission-eval omitting all additional stuff that is used for JCR API compliance. in addition it would allow us try if it was beneficial to use multiple sessions to collect the entries.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment:     (was: test2950.sh)
    
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela updated JCR-2950:
------------------------

    Attachment: JCR-2950-refactor+rootnode_2.patch 

refactor+rootnode patch looks fine as well to me. there are a couple of really trivial things i would change:

- EntryCache#remove returns the result but the return value is never used. unless there is a strong reason i would return void
- added debug output when the cache is updated. Q: was it sensible to have it in the remove method as well? 
- added a little bit of javadoc to the EntryCache class
- removed extra space in the separator line 
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

> This patch just refactors the code and reduces the amount of synchronization. 

looks good. thanks a lot.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-refactor+rootnode_3.patch

Logging slightly improved, and maybe a race condition in updateCache prevented.


                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

Test results:

2.4:
14124 16763 19368 19210
13848 17095 16876 19588
10817 11596 12208 13212 13711

2.6 + T:
 8880 11626 11334 12764 12721 13482
 9471 10623 12632 12747 12836 13117
 8090 11555 12219 12242 14330 12657
 9223 11630 12544 12575 13875 14050
 8475 11007 13499 14744 12692 14749

2.6 + T + root:
12689 15537 17002 17864
11370 13193 15863 15920
 9088 10816 12458 12770 13829 1390
 8831 11324 11128 12305 14258 12391
 9867 11878 15194 13451 15455 18474
 9208 10705 12478 14115 14682 17472

2.6 + S:
 9621 11122 12849 12959 13503 13464
 9530 11312 12667 12127 13342 14475
 9392 11936 12905 14756 13798 13926
 9457 11073 13755 16471 14404 13524
10311 15476 18066 16457
 9905 12883 12012 15857 15890 14427

2.6 + S + root:
 9922 11598 14303 13090 13416 16429
 9494 10894 12679 12643 13894 12900
 9410 11221 13271 15133 17212 15271
 9546 11101 12609 13154 16503
10175 12277 15464 18348 17519
10115 11292 14499 16564 14438

2.6 + P:
10603 12607 14127 15039 14602
10779 12386 14007 14516 15011
10997 12894 14591 17407
10733 12331 13959 14318 16911

2.6 + P + root:
10681 12731 14262 15248 13704
10924 12394 14097 14356 15277
10871 13260 13960 14345 13734
10754 12606 14163 14543 14488


not conclusive at all...




                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_performance_tests.patch.gz
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-refactor+rootnode_7.patch

adds checks for broken entries upon put/update
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: JCR-2950-futures_3.patch

A variant where the updateCache strategy can be selected through a system property (only for testing!)

"org.apache.jackrabbit.core.security.authorization.acl.CachingEntryCollector.strategy"

Values are "S" (synchronized), "T" (throttled; default) and "P" (parallel).
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_performance_tests.patch.gz
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: jcr-2950.png

test results as bar chart
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

alternatively: instead of touching too much internal interfaces we could also think of passing
another Session implementation to the AccessControlProviderFactory.createProvider method (DefaultSecurityManager line 588).
it was then the responsibility of that specific session to delegate calls to the internal pool of system sessions.


                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: cache-empty-aces.csv
                cache-empty-aces.png

Test results using a prefilled cache, caching all nodes (even when no ACEs are there), with (unrealistically) large cache that can hold all nodes.

Summary: caching nodes without ACEs does help, but even with an almost perfect hit rate, we are still much much slower than in the admin case.
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: Julian Reschke
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, auth-prefilled-cache.csv, cache-empty-aces.csv, cache-empty-aces.png, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, syssessioncomparison.csv, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke updated JCR-2950:
--------------------------------

    Attachment: test2950.sh

updated test script
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

Julian Reschke commented on JCR-2950:
-------------------------------------

It appears that a large percentage of requests are actually for the root node. Maybe it would be worthwhile to optimize that case (making it non-blocking)?
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.4
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: angela
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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] [Commented] (JCR-2950) CachingEntryCollector ineffective if number of accessed policies exceeds cache size

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

angela commented on JCR-2950:
-----------------------------

one more idea: passing the pool with the configuration map... as hacky as the other variants ;(
                
> CachingEntryCollector ineffective if number of accessed policies exceeds cache size
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-2950
>                 URL: https://issues.apache.org/jira/browse/JCR-2950
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core, security
>    Affects Versions: 2.2.12, 2.4.2, 2.6
>         Environment: Repository with ACEs > 1000
>            Reporter: Honwai Wong
>            Assignee: Julian Reschke
>         Attachments: CachingEntryCollector.ConcurrentCache-trunk.patch, JCR-2950-concurrent-cache-2.patch, JCR-2950-futures.patch, JCR-2950-futures_2.patch, JCR-2950-futures_3.patch, JCR-2950-futures_4.patch, JCR-2950-refactor+rootnode.patch, JCR-2950-refactor+rootnode_2.patch , JCR-2950-refactor+rootnode_3.patch, JCR-2950-refactor+rootnode_4.patch, JCR-2950-refactor+rootnode_5.patch, JCR-2950-refactor+rootnode_6.patch, JCR-2950-refactor+rootnode_7.patch, JCR-2950-refactor.patch, JCR-2950-throttle.patch, JCR-2950-throttle2.patch, JCR-2950_entryseparation-multisessionhack.patch, JCR-2950_entryseparation.patch, JCR-2950_performance_tests.patch.gz, jcr-2950-2.csv, jcr-2950-2.png, jcr-2950-csv.sh, jcr-2950.csv, jcr-2950.png, test2950.sh
>
>
> The CachingEntryCollector's cache (LRUMap, max size: 1000) seems to become ineffective in case there are more than 1000 ACEs present in the repository. Since access to the cache is synchronized, many threads are basically blocked, waiting to get access to the cache.
> Java callstack:
> at org/apache/jackrabbit/core/security/authorization/acl/CachingEntryCollector.getEntries(CachingEntryCollector.java:99(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/EntryCollector.collectEntries(EntryCollector.java:134(Compiled Code))
> at org/apache/jackrabbit/core/security/authorization/acl/CompiledPermissionsImpl.canRead(CompiledPermissionsImpl.java:250(Compiled Code))
> at org/apache/jackrabbit/core/security/DefaultAccessManager.canRead(DefaultAccessManager.java:251(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.canRead(ItemManager.java:426(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.createItemData(ItemManager.java(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.getItemData(ItemManager.java:379(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:292(Compiled Code))
> at org/apache/jackrabbit/core/ItemManager.itemExists(ItemManager.java:464(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:49(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation$1.perform(SessionItemOperation.java:46(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionItemOperation.perform(SessionItemOperation.java:187(Compiled Code))
> at org/apache/jackrabbit/core/session/SessionState.perform(SessionState.java:200(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.perform(SessionImpl.java:355(Compiled Code))
> at org/apache/jackrabbit/core/SessionImpl.itemExists(SessionImpl.java:751(Compiled Code))

--
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