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

Tomek Rękawek commented on OAK-4912:
------------------------------------

[~vikas], thanks for investigating this! Your comment helped me find the root 
cause - if the background read happens before the last assert in 
testMongoReadPreferencesForLocalChanges, it updates the 
{{MongoDocumentStore#mostRecentAccessedRevisions}} with the revision numbers 
taken from the second DocumentMK instance. They were not present in the 
simulated replica set and hence the error.

I've made the problem fully reproducible (by putting the offending assert in a 
loop with 5 millis delay between iterations) and fixed it by adding second 
DocumentMK revisions to the simulated replica set info.

Fixed in [r1771274|https://svn.apache.org/r1771274].

> MongoDB: ReadPreferenceIT.testMongoReadPreferencesForLocalChanges() 
> occasionally fails
> --------------------------------------------------------------------------------------
>
>                 Key: OAK-4912
>                 URL: https://issues.apache.org/jira/browse/OAK-4912
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, mongomk
>    Affects Versions: 1.5.5
>            Reporter: Julian Reschke
>            Assignee: Tomek Rękawek
>            Priority: Minor
>             Fix For: 1.6, 1.5.15
>
>
> {noformat}
> testMongoReadPreferencesForLocalChanges(org.apache.jackrabbit.oak.plugins.document.mongo.ReadPreferenceIT)
>   Time elapsed: 0.024 sec  <<< FAILURE!
> java.lang.AssertionError: expected:<secondary> but was:<primary>
>         at org.junit.Assert.fail(Assert.java:88)
>         at org.junit.Assert.failNotEquals(Assert.java:834)
>         at org.junit.Assert.assertEquals(Assert.java:118)
>         at org.junit.Assert.assertEquals(Assert.java:144)
>         at 
> org.apache.jackrabbit.oak.plugins.document.mongo.ReadPreferenceIT.testMongoReadPreferencesForLocalChanges(ReadPreferenceIT.java:195)
> {noformat}



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

Reply via email to