[jira] [Comment Edited] (OAK-7101) Stale documents in RDBDocumentStore cache

2018-01-04 Thread Julian Reschke (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-7101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16311527#comment-16311527
 ] 

Julian Reschke edited comment on OAK-7101 at 1/4/18 6:05 PM:
-

trunk: [r1819421|http://svn.apache.org/r1819421] 
[r1818906|http://svn.apache.org/r1818906] 
[r1818903|http://svn.apache.org/r1818903] 
[r1818902|http://svn.apache.org/r1818902] 
[r1818814|http://svn.apache.org/r1818814]
1.6: [r1819427|http://svn.apache.org/r1819427] 
[r1818907|http://svn.apache.org/r1818907] 
[r1818904|http://svn.apache.org/r1818904]
1.4: [r1819429|http://svn.apache.org/r1819429] 
[r1818908|http://svn.apache.org/r1818908] 
[r1818905|http://svn.apache.org/r1818905]
1.2: [r1820108|http://svn.apache.org/r1820108] 
[r1819473|http://svn.apache.org/r1819473] 
[r1818913|http://svn.apache.org/r1818913]
1.0: [r1820162|http://svn.apache.org/r1820162] 
[r1819496|http://svn.apache.org/r1819496] 
[r1818914|http://svn.apache.org/r1818914]



was (Author: reschke):
trunk: [r1819421|http://svn.apache.org/r1819421] 
[r1818906|http://svn.apache.org/r1818906] 
[r1818903|http://svn.apache.org/r1818903] 
[r1818902|http://svn.apache.org/r1818902] 
[r1818814|http://svn.apache.org/r1818814]
1.6: [r1819427|http://svn.apache.org/r1819427] 
[r1818907|http://svn.apache.org/r1818907] 
[r1818904|http://svn.apache.org/r1818904]
1.4: [r1819429|http://svn.apache.org/r1819429] 
[r1818908|http://svn.apache.org/r1818908] 
[r1818905|http://svn.apache.org/r1818905]
1.2: [r1820108|http://svn.apache.org/r1820108] 
[r1819473|http://svn.apache.org/r1819473] 
[r1818913|http://svn.apache.org/r1818913]
1.0: [r1819496|http://svn.apache.org/r1819496] 
[r1818914|http://svn.apache.org/r1818914]


> Stale documents in RDBDocumentStore cache
> -
>
> Key: OAK-7101
> URL: https://issues.apache.org/jira/browse/OAK-7101
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: rdbmk
>Affects Versions: 1.0, 1.4.0, 1.6.0, 1.2.0
>Reporter: Marcel Reutegger
>Assignee: Julian Reschke
> Fix For: 1.0.40, 1.4.19, 1.6.8, 1.8, 1.2.28, 1.7.15
>
> Attachments: OAK-7101.patch, oak-7101.png, query-lock.diff
>
>
> Concurrent query and update operations on RDBDocumentStore may result in 
> stale entries in the document cache.
> Potentially related issues are OAK-5387 and OAK-6062.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (OAK-7101) Stale documents in RDBDocumentStore cache

2018-01-04 Thread Julian Reschke (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-7101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16311523#comment-16311523
 ] 

Julian Reschke edited comment on OAK-7101 at 1/4/18 6:04 PM:
-

Adding sync improvements in 1.2 ([r1820108|http://svn.apache.org/r1820108]) and 
1.0 ([r1820162|http://svn.apache.org/r1820162]) (not applicable to >= 1.4).


was (Author: reschke):
Adding sync improvements in 1.2 ([r1820108|http://svn.apache.org/r1820108]) and 
1.0 (not applicable to >= 1.4).

> Stale documents in RDBDocumentStore cache
> -
>
> Key: OAK-7101
> URL: https://issues.apache.org/jira/browse/OAK-7101
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: rdbmk
>Affects Versions: 1.0, 1.4.0, 1.6.0, 1.2.0
>Reporter: Marcel Reutegger
>Assignee: Julian Reschke
> Fix For: 1.0.40, 1.4.19, 1.6.8, 1.8, 1.2.28, 1.7.15
>
> Attachments: OAK-7101.patch, oak-7101.png, query-lock.diff
>
>
> Concurrent query and update operations on RDBDocumentStore may result in 
> stale entries in the document cache.
> Potentially related issues are OAK-5387 and OAK-6062.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (OAK-7101) Stale documents in RDBDocumentStore cache

2018-01-04 Thread Julian Reschke (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-7101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16311523#comment-16311523
 ] 

Julian Reschke edited comment on OAK-7101 at 1/4/18 3:44 PM:
-

Adding sync improvements in 1.2 ([r1820108|http://svn.apache.org/r1820108]) and 
1.0 (not applicable to >= 1.4).


was (Author: reschke):
Adding sync improvements in 1.2 and 1.0 (not applicable to >= 1.4).

> Stale documents in RDBDocumentStore cache
> -
>
> Key: OAK-7101
> URL: https://issues.apache.org/jira/browse/OAK-7101
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: rdbmk
>Affects Versions: 1.0, 1.4.0, 1.6.0, 1.2.0
>Reporter: Marcel Reutegger
>Assignee: Julian Reschke
> Fix For: 1.0.40, 1.4.19, 1.6.8, 1.8, 1.2.28, 1.7.15
>
> Attachments: OAK-7101.patch, oak-7101.png, query-lock.diff
>
>
> Concurrent query and update operations on RDBDocumentStore may result in 
> stale entries in the document cache.
> Potentially related issues are OAK-5387 and OAK-6062.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (OAK-7101) Stale documents in RDBDocumentStore cache

2018-01-04 Thread Marcel Reutegger (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-7101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16311054#comment-16311054
 ] 

Marcel Reutegger edited comment on OAK-7101 at 1/4/18 9:15 AM:
---

The following diagram shows a possible sequence of calls for a concurrently 
executed query and update:

!oak-7101.png!

The critical section is when the update adds the key to the query context and 
then calls {{replaceCachedDocument}}. Those methods can interleave with the 
query's call to {{mayUpdate}} and {{putIfNewer}}. The problem only occurs when 
the cache does not contain the document at this point. 
{{replaceCachedDocument}} then becomes a NOP and {{putIfNewer}} puts a stale 
document in the cache.


was (Author: mreutegg):
The following diagram shows a possible sequence of calls for a concurrently 
executed query and update:

[^OAK-7101.png]

The critical section is when the update adds the key to the query context and 
then calls {{replaceCachedDocument}}. Those methods can interleave with the 
query's call to {{mayUpdate}} and {{putIfNewer}}. The problem only occurs when 
the cache does not contain the document at this point. 
{{replaceCachedDocument}} then becomes a NOP and {{putIfNewer}} puts a stale 
document in the cache.

> Stale documents in RDBDocumentStore cache
> -
>
> Key: OAK-7101
> URL: https://issues.apache.org/jira/browse/OAK-7101
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: rdbmk
>Affects Versions: 1.0, 1.4.0, 1.6.0, 1.2.0
>Reporter: Marcel Reutegger
>Assignee: Julian Reschke
> Fix For: 1.0.40, 1.4.19, 1.6.8, 1.8, 1.2.28, 1.7.15
>
> Attachments: OAK-7101.patch, oak-7101.png, query-lock.diff
>
>
> Concurrent query and update operations on RDBDocumentStore may result in 
> stale entries in the document cache.
> Potentially related issues are OAK-5387 and OAK-6062.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (OAK-7101) Stale documents in RDBDocumentStore cache

2017-12-29 Thread Julian Reschke (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-7101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305396#comment-16305396
 ] 

Julian Reschke edited comment on OAK-7101 at 12/29/17 2:53 PM:
---

trunk: [r1819421|http://svn.apache.org/r1819421] 
[r1818906|http://svn.apache.org/r1818906] 
[r1818903|http://svn.apache.org/r1818903] 
[r1818902|http://svn.apache.org/r1818902] 
[r1818814|http://svn.apache.org/r1818814]
1.6: [r1819427|http://svn.apache.org/r1819427] 
[r1818907|http://svn.apache.org/r1818907] 
[r1818904|http://svn.apache.org/r1818904]
1.4: [r1819429|http://svn.apache.org/r1819429] 
[r1818908|http://svn.apache.org/r1818908] 
[r1818905|http://svn.apache.org/r1818905]
1.2: [r1819473|http://svn.apache.org/r1819473] 
[r1818913|http://svn.apache.org/r1818913]
1.0: [r1819496|http://svn.apache.org/r1819496] 
[r1818914|http://svn.apache.org/r1818914]



was (Author: reschke):
trunk: [r1819421|http://svn.apache.org/r1819421] 
[r1818906|http://svn.apache.org/r1818906] 
[r1818903|http://svn.apache.org/r1818903] 
[r1818902|http://svn.apache.org/r1818902] 
[r1818814|http://svn.apache.org/r1818814]
1.6: [r1819427|http://svn.apache.org/r1819427] 
[r1818907|http://svn.apache.org/r1818907] 
[r1818904|http://svn.apache.org/r1818904]
1.4: [r1819429|http://svn.apache.org/r1819429] 
[r1818908|http://svn.apache.org/r1818908] 
[r1818905|http://svn.apache.org/r1818905]
1.2: [r1819473|http://svn.apache.org/r1819473] 
[r1818913|http://svn.apache.org/r1818913]
1.0: [r1818914|http://svn.apache.org/r1818914]


> Stale documents in RDBDocumentStore cache
> -
>
> Key: OAK-7101
> URL: https://issues.apache.org/jira/browse/OAK-7101
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: rdbmk
>Affects Versions: 1.0, 1.4.0, 1.6.0, 1.2.0
>Reporter: Marcel Reutegger
>Assignee: Julian Reschke
> Fix For: 1.0.40, 1.4.19, 1.6.8, 1.8, 1.2.28, 1.7.15
>
> Attachments: OAK-7101.patch
>
>
> Concurrent query and update operations on RDBDocumentStore may result in 
> stale entries in the document cache.
> Potentially related issues are OAK-5387 and OAK-6062.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (OAK-7101) Stale documents in RDBDocumentStore cache

2017-12-29 Thread Julian Reschke (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-7101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305396#comment-16305396
 ] 

Julian Reschke edited comment on OAK-7101 at 12/29/17 10:58 AM:


trunk: [r1819421|http://svn.apache.org/r1819421] 
[r1818906|http://svn.apache.org/r1818906] 
[r1818903|http://svn.apache.org/r1818903] 
[r1818902|http://svn.apache.org/r1818902] 
[r1818814|http://svn.apache.org/r1818814]
1.6: [r1819427|http://svn.apache.org/r1819427] 
[r1818907|http://svn.apache.org/r1818907] 
[r1818904|http://svn.apache.org/r1818904]
1.4: [r1819429|http://svn.apache.org/r1819429] 
[r1818908|http://svn.apache.org/r1818908] 
[r1818905|http://svn.apache.org/r1818905]
1.2: [r1819473|http://svn.apache.org/r1819473] 
[r1818913|http://svn.apache.org/r1818913]
1.0: [r1818914|http://svn.apache.org/r1818914]



was (Author: reschke):
trunk: [r1819421|http://svn.apache.org/r1819421] 
[r1818906|http://svn.apache.org/r1818906] 
[r1818903|http://svn.apache.org/r1818903] 
[r1818902|http://svn.apache.org/r1818902] 
[r1818814|http://svn.apache.org/r1818814]
1.6: [r1819427|http://svn.apache.org/r1819427] 
[r1818907|http://svn.apache.org/r1818907] 
[r1818904|http://svn.apache.org/r1818904]
1.4: [r1819429|http://svn.apache.org/r1819429] 
[r1818908|http://svn.apache.org/r1818908] 
[r1818905|http://svn.apache.org/r1818905]
1.2: [r1818913|http://svn.apache.org/r1818913]
1.0: [r1818914|http://svn.apache.org/r1818914]


> Stale documents in RDBDocumentStore cache
> -
>
> Key: OAK-7101
> URL: https://issues.apache.org/jira/browse/OAK-7101
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: rdbmk
>Affects Versions: 1.0, 1.4.0, 1.6.0, 1.2.0
>Reporter: Marcel Reutegger
>Assignee: Julian Reschke
>  Labels: candidate_oak_1_0
> Fix For: 1.4.19, 1.6.8, 1.8, 1.2.28, 1.7.15
>
> Attachments: OAK-7101.patch
>
>
> Concurrent query and update operations on RDBDocumentStore may result in 
> stale entries in the document cache.
> Potentially related issues are OAK-5387 and OAK-6062.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (OAK-7101) Stale documents in RDBDocumentStore cache

2017-12-29 Thread Julian Reschke (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-7101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305591#comment-16305591
 ] 

Julian Reschke edited comment on OAK-7101 at 12/29/17 10:48 AM:


The logic in 1.0 and 1.2 is different, there is no CacheChangesTracker here.

I have an alternate solution that uses the old QueryContext. It makes the test 
pass, but might be not 100% perfect. Committing this now as it makes the test 
pass. The alternative would be to port the CacheChangesTracker back (cc 
[~mreutegg] and [~catholicon]).


was (Author: reschke):
WIP note: the logic in 1.2 and earlier is different, so we either need a 
different fix, or backport more from newer branches...

> Stale documents in RDBDocumentStore cache
> -
>
> Key: OAK-7101
> URL: https://issues.apache.org/jira/browse/OAK-7101
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: rdbmk
>Affects Versions: 1.0, 1.4.0, 1.6.0, 1.2.0
>Reporter: Marcel Reutegger
>Assignee: Julian Reschke
>  Labels: candidate_oak_1_2
> Fix For: 1.4.19, 1.6.8, 1.8, 1.7.15
>
> Attachments: OAK-7101.patch
>
>
> Concurrent query and update operations on RDBDocumentStore may result in 
> stale entries in the document cache.
> Potentially related issues are OAK-5387 and OAK-6062.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (OAK-7101) Stale documents in RDBDocumentStore cache

2017-12-28 Thread Julian Reschke (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-7101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305396#comment-16305396
 ] 

Julian Reschke edited comment on OAK-7101 at 12/28/17 3:28 PM:
---

trunk: [r1819421|http://svn.apache.org/r1819421] 
[r1818906|http://svn.apache.org/r1818906] 
[r1818903|http://svn.apache.org/r1818903] 
[r1818902|http://svn.apache.org/r1818902] 
[r1818814|http://svn.apache.org/r1818814]
1.6: [r1819427|http://svn.apache.org/r1819427] 
[r1818907|http://svn.apache.org/r1818907] 
[r1818904|http://svn.apache.org/r1818904]
1.4: [r1819429|http://svn.apache.org/r1819429] 
[r1818908|http://svn.apache.org/r1818908] 
[r1818905|http://svn.apache.org/r1818905]
1.2: [r1818913|http://svn.apache.org/r1818913]
1.0: [r1818914|http://svn.apache.org/r1818914]



was (Author: reschke):
trunk: [r1819421|http://svn.apache.org/r1819421] 
[r1818906|http://svn.apache.org/r1818906] 
[r1818903|http://svn.apache.org/r1818903] 
[r1818902|http://svn.apache.org/r1818902] 
[r1818814|http://svn.apache.org/r1818814]
1.6: [r1819427|http://svn.apache.org/r1819427] 
[r1818907|http://svn.apache.org/r1818907] 
[r1818904|http://svn.apache.org/r1818904]
1.4: [r1818908|http://svn.apache.org/r1818908] 
[r1818905|http://svn.apache.org/r1818905]
1.2: [r1818913|http://svn.apache.org/r1818913]
1.0: [r1818914|http://svn.apache.org/r1818914]


> Stale documents in RDBDocumentStore cache
> -
>
> Key: OAK-7101
> URL: https://issues.apache.org/jira/browse/OAK-7101
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: rdbmk
>Affects Versions: 1.0, 1.4.0, 1.6.0, 1.2.0
>Reporter: Marcel Reutegger
>Assignee: Julian Reschke
>  Labels: candidate_oak_1_2
> Fix For: 1.4.19, 1.6.8, 1.8, 1.7.15
>
> Attachments: OAK-7101.patch
>
>
> Concurrent query and update operations on RDBDocumentStore may result in 
> stale entries in the document cache.
> Potentially related issues are OAK-5387 and OAK-6062.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (OAK-7101) Stale documents in RDBDocumentStore cache

2017-12-28 Thread Julian Reschke (JIRA)

[ 
https://issues.apache.org/jira/browse/OAK-7101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16305396#comment-16305396
 ] 

Julian Reschke edited comment on OAK-7101 at 12/28/17 2:37 PM:
---

trunk: [r1819421|http://svn.apache.org/r1819421] 
[r1818906|http://svn.apache.org/r1818906] 
[r1818903|http://svn.apache.org/r1818903] 
[r1818902|http://svn.apache.org/r1818902] 
[r1818814|http://svn.apache.org/r1818814]
1.6: [r1819427|http://svn.apache.org/r1819427] 
[r1818907|http://svn.apache.org/r1818907] 
[r1818904|http://svn.apache.org/r1818904]
1.4: [r1818908|http://svn.apache.org/r1818908] 
[r1818905|http://svn.apache.org/r1818905]
1.2: [r1818913|http://svn.apache.org/r1818913]
1.0: [r1818914|http://svn.apache.org/r1818914]



was (Author: reschke):
trunk: [r1819421|http://svn.apache.org/r1819421] 
[r1818906|http://svn.apache.org/r1818906] 
[r1818903|http://svn.apache.org/r1818903] 
[r1818902|http://svn.apache.org/r1818902] 
[r1818814|http://svn.apache.org/r1818814]
1.6: [r1818907|http://svn.apache.org/r1818907] 
[r1818904|http://svn.apache.org/r1818904]
1.4: [r1818908|http://svn.apache.org/r1818908] 
[r1818905|http://svn.apache.org/r1818905]
1.2: [r1818913|http://svn.apache.org/r1818913]
1.0: [r1818914|http://svn.apache.org/r1818914]


> Stale documents in RDBDocumentStore cache
> -
>
> Key: OAK-7101
> URL: https://issues.apache.org/jira/browse/OAK-7101
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: rdbmk
>Affects Versions: 1.0, 1.4.0, 1.6.0, 1.2.0
>Reporter: Marcel Reutegger
>Assignee: Julian Reschke
>  Labels: candidate_oak_1_4
> Fix For: 1.6.8, 1.8, 1.7.15
>
> Attachments: OAK-7101.patch
>
>
> Concurrent query and update operations on RDBDocumentStore may result in 
> stale entries in the document cache.
> Potentially related issues are OAK-5387 and OAK-6062.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)