[ https://issues.apache.org/jira/browse/OAK-3554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15000543#comment-15000543 ]
Marcel Reutegger commented on OAK-3554: --------------------------------------- For now I didn't change the write concern when connected to a single MongoDB instance. The performance impact with the default journalCommitInterval is too big for a setup that is not recommended in production. I think we should create a separate issue for this case and discuss options. When connected to a replica set, MongoMK now uses the MAJORITY write concern, unless the the MongoDB URI has an explicit write concern set. The DocumentMK.Builder now checks if the write concern is sufficient for the setup and logs a warning. I didn't change the behavior of the existing setMongoDB() methods on the builder. The expectation now is that a client knows what it is doing when it passes a DB object to the builder and MongoMK will use the current set write concern on the DB. Though, it does perform a check and logs the above mentioned warning if the write concern is considered insufficient. Done in trunk: http://svn.apache.org/r1713875 and http://svn.apache.org/r1713876 > 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: core, mongomk > Reporter: Chetan Mehrotra > Assignee: Marcel Reutegger > Labels: resilience > Fix For: 1.4 > > > 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)