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 "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2015/11/05 09:15:27 UTC

[jira] [Commented] (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=14991306#comment-14991306 ] 

Marcel Reutegger commented on OAK-3554:
---------------------------------------

I implemented the proposed changes to the default WriteConcern and the performance
impact for single MongoDB instance setup with JOURNALED is huge.

It seems this is caused by how MongoDB interacts with its journal. IIUC the
journal is flushed with a fixed scheduled interval. This can be configured
and per default the interval is 100 ms. Now, whenever a write operation
comes in with a write concern of JOURNALED, the operation simply seems to
wait for the scheduled journal flush. According to the [documentation|https://docs.mongodb.org/manual/reference/configuration-options/#storage.mmapv1.journal.commitIntervalMs], the
write operation temporarily reduce the interval to a third of the configured
time, but this still means each write operation will wait for an average
of 16 ms (no matter how fast your disk is).

The SetPropertyTest benchmark is 50 times slower with this change compared
to ACKNOWLEDGED:

{noformat}
# SetPropertyTest                  C     min     10%     50%     90%     max       N
Oak-MongoNS                        1   78898   78898   78898   78898   78898       1
{noformat}

vs. current trunk:

{noformat}
# SetPropertyTest                  C     min     10%     50%     90%     max       N
Oak-MongoNS                        1    1307    1334    1420    1589    1737      42
{noformat}

Reducing the journalCommitInterval to 2 ms gives the following results:

{noformat}
# SetPropertyTest                  C     min     10%     50%     90%     max       N
Oak-MongoNS                        1    3690    3732    3926    4436    4509      16
{noformat}


> 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.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)