<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 07:39:27 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[DOCS-755] Documentation doesn&apos;t cover the lifetime of a write operation and how it interacts with GetLast Error</title>
                <link>https://jira.mongodb.org/browse/DOCS-755</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;The following facts about replication and GetLastError are not explicitly documented anywhere:&lt;/p&gt;

&lt;p&gt; When you do a default write to MongoDB, then the client program does not receive any validation that the write has made it into MongoDB. Assuming that the write succeeds, the data in the write will go through the following steps:&lt;/p&gt;

&lt;p&gt; a) It will be validated: that is, the insert or update will be checked for validity. This includes things like making sure that an update refers to a document that exists, making sure that an insert doesn&apos;t violate a unique index constraint, etc.&lt;br/&gt;
 b) The modified document will be written to an in-memory copy of the data files.&lt;br/&gt;
 c) An oplog entry will be written to an in-memory copy of the oplog&lt;br/&gt;
 d) The data will be written to the in-memory journal group&lt;br/&gt;
 e) The journal will be flushed to disk. This flush will include the journal entries for both the modified document and the oplog entry.&lt;br/&gt;
 f) At some (indeterminate) time later, the both the oplog entry and the modified document will be synced to disk, not necessarily at the same time.&lt;br/&gt;
 g) At some time later, the oplog entry will be replicated to one or more secondary nodes, which will repeat all steps a-f on that node&lt;/p&gt;

&lt;p&gt;2) When you follow-up that write with a getLastError command, you can validate that the write has made it to a certain state in the above sequence:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;A default getLastError (without options) will guarantee that the write has progressed to state (b)&lt;/li&gt;
	&lt;li&gt;A getLastError command with 
{j:true}
&lt;p&gt; will guarantee that the write has progressed to state (e)&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;A getLastError command with 
{w:2}
&lt;p&gt; will guarantee that the write has progressed to state (g) on the primary node, and has reached state (b) on at least one secondary&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;A getLastError command with 
{w:N}
&lt;p&gt;, where N is greater than 2, will guarantee that the write has reached state (g) on the primary; has been replicated to at least (N-1) secondary nodes; and has reached state (b) on all of those nodes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
                <environment></environment>
        <key id="56390">DOCS-755</key>
            <summary>Documentation doesn&apos;t cover the lifetime of a write operation and how it interacts with GetLast Error</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="sam.kleinman">Sam Kleinman</assignee>
                                    <reporter username="william.zola@10gen.com">William Zola</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Nov 2012 20:04:26 +0000</created>
                <updated>Wed, 14 Nov 2012 20:11:34 +0000</updated>
                            <resolved>Wed, 14 Nov 2012 20:11:34 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 14 Nov 2012 20:11:34 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 14 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>jess.mokrzecki@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 14 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>sam.kleinman</customfieldvalue>
            <customfieldvalue>william.zola@10gen.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrs7gv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrkkdr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>33751</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hryikv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                </customfields>
    </item>
</channel>
</rss>