You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Tomek Rękawek (JIRA)" <ji...@apache.org> on 2016/12/08 09:23:58 UTC

[jira] [Commented] (OAK-4069) Use read concern majority when connected to a replica set

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

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

Patch attached. I tried to stay as close as possible to the existing writeConcern support / checks. I upgraded the Mongo driver to 3.3, since it has better support for readConcern (DB class setter/getter). According to the [docs|https://docs.mongodb.com/ecosystem/drivers/java/], the 3.3 driver should be compatible with MongoDB 3.2.

[~mreutegg], could you take a look on the patch?

> Use read concern majority when connected to a replica set
> ---------------------------------------------------------
>
>                 Key: OAK-4069
>                 URL: https://issues.apache.org/jira/browse/OAK-4069
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mongomk
>            Reporter: Tomek Rękawek
>            Assignee: Tomek Rękawek
>              Labels: resilience
>             Fix For: 1.6, 1.5.16
>
>         Attachments: OAK-4069.patch
>
>
> Mongo 3.2 introduces new query option: {{readConcern}}. It allows to read only these changes that have been already committed to the majority of secondary instances.
> It prevents stale reads - a situation in which a change has been committed on the primary (and read from it), but due to the network partition a new primary is elected and the change is rolled back.
> We should use this new option (together with {{w:majority}} implemented in OAK-3554) when running Oak on MongoDB replica set.
> References:
> * [Jepsen: MongoDB stale reads|https://aphyr.com/posts/322-jepsen-mongodb-stale-reads]
> * [MongoDB documentation: Read Concern in|https://docs.mongodb.org/manual/reference/read-concern/]



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