[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-02-11 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on OAK-3634:
-

trunk: http://svn.apache.org/r1723350 http://svn.apache.org/r1723251 
http://svn.apache.org/r1723241
1.2: http://svn.apache.org/r1725938 http://svn.apache.org/r1725919
1.0: http://svn.apache.org/r1729947 http://svn.apache.org/r1729879


> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
> Fix For: 1.3.14, 1.2.11, 1.0.28
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-02-11 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3634:


Ack.

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>  Labels: candidate_oak_1_0
> Fix For: 1.3.14, 1.2.11
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-02-11 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3634:


[~mreutegg], [~reschke], to me this seems worth porting back to 1.0 as well. 
Wdyt?

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>  Labels: candidate_oak_1_0
> Fix For: 1.3.14, 1.2.11
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-02-11 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on OAK-3634:
-

Yes, that's why it's labeled as 1.0 candidate :-). If the actual change did 
apply without conflicts, I'd go ahead with the change for the 1.0.28. (Does it?)

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>  Labels: candidate_oak_1_0
> Fix For: 1.3.14, 1.2.11
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-02-11 Thread Vikas Saurabh (JIRA)

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

Vikas Saurabh commented on OAK-3634:


If "http://svn.apache.org/r1725938 http://svn.apache.org/r1725919; these are 
the only changes that are required, I can try to put up a patch at 1.0 branch. 
I haven't followed this issue closely, so not sure of the what exact changes 
were required.

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>  Labels: candidate_oak_1_0
> Fix For: 1.3.14, 1.2.11
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-02-11 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on OAK-3634:
-

[~catholicon] I'd like to try to backport other earlier changes before, so that 
merging stays simple. Let me try to start with OAK-3649 first...

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>  Labels: candidate_oak_1_0
> Fix For: 1.3.14, 1.2.11
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-01-21 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on OAK-3634:
-

trunk: http://svn.apache.org/r1723350 http://svn.apache.org/r1723251 
http://svnapache.org/r1723241
1.2: http://svn.apache.org/r1725919


> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>  Labels: candidate_oak_1_0
> Fix For: 1.3.14, 1.2.11
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-01-06 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on OAK-3634:
-

Looks good to me.

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>  Labels: candidate_oak_1_0, candidate_oak_1_2
> Fix For: 1.3.14
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-01-06 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on OAK-3634:
-

For MongoDocumentStore, the Eclipse Java compiler complains about line 907:

 && (postUpdateModCount.longValue() - 1) == entry.getValue().getModCount()) {

"Incompatible operand types long and Number"



> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
>  Labels: candidate_oak_1_0, candidate_oak_1_2
> Fix For: 1.3.14
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-01-05 Thread Marcel Reutegger (JIRA)

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

Marcel Reutegger commented on OAK-3634:
---

Added Julian's additional MultiDocumentStoreTest from his patch and a new test, 
which reproduces the issue with the temporary cache inconsistency raised 
yesterday. Tests are currently ignored. In trunk: http://svn.apache.org/r1723241

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
> Fix For: 1.4
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-01-05 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on OAK-3634:
-

[~mreutegg]: if I understand correctly, the change clears the cache at the end 
of the method call. Doesn't that mean that we still have time window in which 
the cache contains the incorrect entries? Shouldn't we avoid updating the cache 
in the first place?

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
> Fix For: 1.4
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2016-01-05 Thread Marcel Reutegger (JIRA)

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

Marcel Reutegger commented on OAK-3634:
---

You are right, this could still be a problem.

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.2.7, 1.3.10, 1.0.23
>Reporter: Julian Reschke
>Assignee: Marcel Reutegger
> Fix For: 1.4
>
> Attachments: OAK-3634.diff, OAK-3634.diff, OAK-3634.patch
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2015-11-18 Thread Marcel Reutegger (JIRA)

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

Marcel Reutegger commented on OAK-3634:
---

I agree with you. Change the test and require update() to correctly reflect 
changes in the cache that happened before.

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.3.10
>Reporter: Julian Reschke
> Attachments: OAK-3634.diff
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2015-11-18 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on OAK-3634:
-

So how do we proceed from here?

1) The aforementioned unit test checks something we intend to change (and I'm 
guilty of writing that test). Should we fix/remove the test?

2) My concern is that allowing update() to populate the cache with potentially 
incorrect information will make it harder to debug other caching related 
issues, thus I'd propose to fix it right away.

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.3.10
>Reporter: Julian Reschke
> Attachments: OAK-3634.diff
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2015-11-18 Thread Marcel Reutegger (JIRA)

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

Marcel Reutegger commented on OAK-3634:
---

For consistency with behavior of other write operations in the DocumentStore, I 
would still suggest to fix/change update(). All other write operations make 
changes visible that happened before. This is a requirement for conflict 
detection. So far the conflict detection does not depend on update(), which 
probably means there is no urgent need to change the current implementation. A 
commit either uses create(), createOrUpdate() or findAndUpdate(). Those 
operations ensure the happens before semantics.

> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.3.10
>Reporter: Julian Reschke
> Attachments: OAK-3634.diff
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (OAK-3634) RDB/MongoDocumentStore may return stale documents

2015-11-17 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on OAK-3634:
-

Had a closer look, with somewhat surprising results.

1) The current behavior is easily understood as it's fully intentional: an 
{{update()}} operation will apply the changes in memory and update the cache if 
it contains exactly the document that the UpdateOp was applied to. This implies 
that we'll put something into the cache without knowing its persisted state. 
(Note that RDB and Mongo behave exactly the same way here because the caching 
logic for RDB was copied from Mongo back then).

Fixing this is trivial (ignoring performance for now): just remove the logic 
that attempts to update the cache and invalidate instead.

But, surprise:

2) We actually have a test case that *expects* the behavior that this issue is 
about; {{MultiDocumentStoreTest.testInterleavedUpdate2()}} which consequently 
starts failing once the DS implementation caches less aggressively.



> RDB/MongoDocumentStore may return stale documents
> -
>
> Key: OAK-3634
> URL: https://issues.apache.org/jira/browse/OAK-3634
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: mongomk, rdbmk
>Affects Versions: 1.3.10
>Reporter: Julian Reschke
> Attachments: OAK-3634.diff
>
>
> It appears that the implementations of the {{update}} method sometimes 
> populate the memory cache with documents that do not reflect any current or 
> previous state in the persistence (that is, miss changes made by another 
> node).
> (will attach test)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)