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 "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2015/10/27 14:18:27 UTC

[jira] [Comment Edited] (OAK-3554) Use write concern of w:majority when connected to a replica set

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

Chetan Mehrotra edited comment on OAK-3554 at 10/27/15 1:18 PM:
----------------------------------------------------------------

Had a discussion with Marcel and Vikas on this and below is the revised proposal. 

To avoid use w:majority for *all* operations and still be able to guarantee that a Commit does not end up in partial state due to rollback in case of replica state change following approach can be taken

# Ensure that all operation made as part of given commit are routed to same primary server
# Ensure that final operation of updating the commit root is done with w:majority

Caveats/Assumptions
* This is only proposed for non sharded env where Oak instance is directly communicating with Mongo replica set and not via mongos
* It assume that a for seq of operation \[o1->w:1, o2->w:1, o3->w:majority\]. If o3 went fine (with above conditions) then o1 and o2 would also have made it to the majority of replica set nodes i.e. order of operation done is maintained in replication log
This would ensure that in case of any partial rollback a commit is not marked as valid. How it is implemented would need to be worked out as it depends on 
# Mongo Java Driver providing information around where the writes ended up
# Ability to manage transaction state in DocumentNodeStore




was (Author: chetanm):
Had a discussion with Marcel and Vikas on this and below is the revised proposal. 

To avoid use w:majority for *all* operations and still be able to guarantee that a Commit does not end up in partial state due to rollback in case of replica state change following approach can be taken

# Ensure that all operation made as part of given commit are routed to same primary server
# Ensure that final operation of updating the commit root is done with w:majority

This would ensure that in case of any partial rollback a commit is not marked as valid. How it is implemented would need to be worked out as it depends on 
# Mongo Java Driver providing information around where the writes ended up
# Ability to manage transaction state in DocumentNodeStore



> Use write concern of w:majority when connected to a replica set
> ---------------------------------------------------------------
>
>                 Key: OAK-3554
>                 URL: https://issues.apache.org/jira/browse/OAK-3554
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mongomk
>            Reporter: Chetan Mehrotra
>             Fix For: 1.3.10
>
>
> Currently while connecting to Mongo MongoDocumentStore relies on default write concern provided as part of mongouri. 
> Recently some issues were seen where Mongo based Oak was connecting to 3 member replica set and there were frequent replica state changes due to use of VM for Mongo. This caused data loss and corruption of data in Oak.
> To avoid such situation Oak should default to write concern of majority by default. If some write concern is specified as part of mongouri then that should take precedence. This would allow system admin to take the call of tweaking write concern if required and at same time allows Oak to use the safe write concern.



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