[
https://issues.apache.org/jira/browse/JCR-4007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15440596#comment-15440596
]
Woonsan Ko edited comment on JCR-4007 at 8/27/16 4:00 AM:
----------------------------------------------------------
If I understood it correctly, JCR-3817 was originally about asynchronous
touching when {{org.apache.jackrabbit.core.gc.GarbageCollector}} starts
marking. When {{org.apache.jackrabbit.core.gc.GarbageCollector}} starts
marking, it invokes {{DataStore.updateModifiedDateOnAccess(long)}} with current
timestamp, and it resets it to 0 back after marking done.
So, a {{DataStore}} is supposed to update lastModifiedDate when reading a
record *only during* the marking process of the {{GarbageCollector}}, not every
time in {{getRecord()}} operation. It should not update last modified timestamp
if GarbageCollector is not working.
With JCR-3817 fix, it seems to have touched records every time in
{{#getRecord()}} without considering the {{minModifiedDate}} value (set by
{{#updateModifiedDateOnAccess(long)}} by {{GarbageCollector}}). This was
unnecessary and causing a performance degrade.
Therefore, the fix should be to invoke {{#touchInternal()}} only when
{{minModifiedDate}} is greater than zero.
was (Author: woon_san):
If I understood it correctly, JCR-3817 was originally about asynchronous
touching when {{org.apache.jackrabbit.core.gc.GarbageCollector}} starts
marking. When {{org.apache.jackrabbit.core.gc.GarbageCollector}} starts
marking, it invokes {{DataStore.updateModifiedDateOnAccess(long)}} with current
timestamp, and it resets it to 0 back after marking done.
So, a {{DataStore}} is supposed to update lastModifiedTimestamp when reading a
record *only during* the marking process of the {{GarbageCollector}}, not every
time in {{getRecord()}} operation. It should not update last modified timestamp
if GarbageCollector is not working.
With JCR-3817 fix, it seems to have touched records every time in
{{#getRecord()}} without considering the {{minModifiedDate}} value (set by
{{#updateModifiedDateOnAccess(long)}} by {{GarbageCollector}}. This was
unnecessary and causing a performance degrade.
Therefore, the fix should be to invoke {{#touchInternal()}} only when
{{minModifiedDate}} is greater than zero.
> CachingDataStore - touching every time on getRecord() was unnecessary
> ---------------------------------------------------------------------
>
> Key: JCR-4007
> URL: https://issues.apache.org/jira/browse/JCR-4007
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Affects Versions: 2.13.2
> Reporter: Woonsan Ko
> Fix For: 2.13.3
>
>
> At the moment, {{CachingDataStore#getRecord()}} always invokes
> {{#touchInternal()}}, resulting in touching the file *every time* through the
> backend whenever reading a record. This seems to cause a performance degrade
> even when cached locally.
> Touching (updating the lastModifiedDate) must not be done every time. It
> should be done only when {{minModifiedDate}} is set to a number greater than
> zero by {{org.apache.jackrabbit.core.gc.GarbageCollector}} while marking.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)