<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:59:29 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>[SERVER-2276]  Lost Data  while Master in Replica set went down</title>
                <link>https://jira.mongodb.org/browse/SERVER-2276</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>
&lt;p&gt; Lost Data  while Master in Replica set went down&lt;/p&gt;

&lt;p&gt;Lost data  when i killed master while inserting data through mongos shell.&lt;/p&gt;

&lt;p&gt;I don&apos;t see any rollback files in any of the data directories.&lt;/p&gt;


&lt;p&gt;Configuration:&lt;/p&gt;

&lt;p&gt;Replica Set dbs&lt;/p&gt;

&lt;p&gt;mongod --fork --rest --port 30001 --replSet set1/localhost:30001,localhost:30002,localhost:30003  --shardsvr --oplogSize 500 --dbpath /home/mongo/data/db/s1r1 --logpath /home/mongo/logs/s1r1.log&lt;br/&gt;
mongod --fork --rest --port 30002 --replSet set1/localhost:30001,localhost:30002,localhost:30003 --shardsvr --oplogSize 500 --dbpath /home/mongo/data/db/s1r2 --logpath /home/mongo/logs/s1r2.log&lt;br/&gt;
mongod --fork --rest --port 30003 --replSet set1/localhost:30001,localhost:30002,localhost:30003 --shardsvr --oplogSize 500 --dbpath /home/mongo/data/db/s1r3 --logpath /home/mongo/logs/s1r3.log&lt;br/&gt;
mongod --fork --rest --port 30004 --replSet set1 --logpath /home/mongo/logs/arbiter1_set1.log --dbpath /home/mongo/data/db/s1/arbiter1 --oplogSize 500&lt;br/&gt;
mongod --fork --rest --port 30005 --replSet set1 --logpath /home/mongo/logs/arbiter2_set1.log --dbpath /home/mongo/data/db/s1/arbiter2 --oplogSize 500&lt;/p&gt;


&lt;p&gt;Replica configuration:&lt;/p&gt;

&lt;p&gt;new_config = {_id: &apos;set1&apos;, members: [&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{_id: 0, host: &apos;localhost:30001&apos;},&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{_id: 1, host: &apos;localhost:30002&apos;},&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{_id: 2, host: &apos;localhost:30003&apos;},&lt;br/&gt;
		       {_id: 3, host: &apos;localhost:30004&apos;,arbiterOnly: true},&lt;br/&gt;
		       {_id: 4, host: &apos;localhost:30005&apos;,arbiterOnly: true}]&lt;br/&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&lt;/p&gt;

&lt;p&gt;Configuration Server&lt;/p&gt;

&lt;p&gt;mongod --fork --configsvr --port 20001 --dbpath /home/mongo/data/db/config1 --logpath /home/mongo/logs/config1.log&lt;/p&gt;

&lt;p&gt;Mongos&lt;/p&gt;

&lt;p&gt;mongos --fork --configdb localhost:20001 --chunkSize 1 --logpath /home/mongo/logs/mongos.log&lt;/p&gt;


&lt;p&gt;&amp;gt; rs.status()&lt;br/&gt;
{&lt;br/&gt;
        &quot;set&quot; : &quot;set1&quot;,&lt;br/&gt;
        &quot;date&quot; : &quot;Wed Dec 22 2010 14:47:07 GMT-0500 (EST)&quot;,&lt;br/&gt;
        &quot;myState&quot; : 1,&lt;br/&gt;
        &quot;members&quot; : [&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 0,
                        &quot;name&quot; : &quot;db6.moon-ray.com:30001&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 1,
                        &quot;self&quot; : true
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 1,
                        &quot;name&quot; : &quot;localhost:30002&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 2,
                        &quot;uptime&quot; : 30,
                        &quot;lastHeartbeat&quot; : &quot;Wed Dec 22 2010 14:47:07 GMT-0500 (EST)&quot;
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 2,
                        &quot;name&quot; : &quot;localhost:30003&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 2,
                        &quot;uptime&quot; : 24,
                        &quot;lastHeartbeat&quot; : &quot;Wed Dec 22 2010 14:47:07 GMT-0500 (EST)&quot;
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 3,
                        &quot;name&quot; : &quot;localhost:30004&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 7,
                        &quot;uptime&quot; : 26,
                        &quot;lastHeartbeat&quot; : &quot;Wed Dec 22 2010 14:47:07 GMT-0500 (EST)&quot;
                }
&lt;p&gt;,&lt;/p&gt;
                {
                        &quot;_id&quot; : 4,
                        &quot;name&quot; : &quot;localhost:30005&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 7,
                        &quot;uptime&quot; : 26,
                        &quot;lastHeartbeat&quot; : &quot;Wed Dec 22 2010 14:47:07 GMT-0500 (EST)&quot;
                }
&lt;p&gt;        ],&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;added sharding config through mongos&lt;/p&gt;

&lt;p&gt;db.runCommand( &lt;/p&gt;
{ addshard : &quot;set1/localhost:30001,localhost:30002,localhost:30003&quot;, name : &quot;shard1&quot; }
&lt;p&gt; );&lt;/p&gt;

&lt;p&gt; db.runCommand(&lt;/p&gt;
{listshards:1}
&lt;p&gt;)                                                                                               &lt;br/&gt;
{&lt;br/&gt;
        &quot;shards&quot; : [&lt;/p&gt;
                {
                        &quot;_id&quot; : &quot;shard1&quot;,
                        &quot;host&quot; : &quot;set1/localhost:30001,localhost:30002,localhost:30003&quot;
                }
&lt;p&gt;        ],&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;inserted some data&lt;/p&gt;


&lt;p&gt;use demo_contacts&lt;/p&gt;

&lt;p&gt;db.contacts.count()&lt;br/&gt;
300000&lt;/p&gt;

&lt;p&gt;Killed master while inserting data.&lt;br/&gt;
&amp;gt; db.contacts.count()&lt;br/&gt;
300000&lt;br/&gt;
&amp;gt; for (var i = 1; i &amp;lt;= 100000; i++) db.contacts.save({aid:4, contact_id:i,test_string: &quot;This is test string to test mongodb s&amp;gt;&lt;br/&gt;
&amp;gt; db.contacts.count()                                                               &lt;br/&gt;
399981&lt;br/&gt;
&amp;gt; &lt;/p&gt;


&lt;p&gt;~                                                                                                                                                       &lt;/p&gt;</description>
                <environment>CentOs 5</environment>
        <key id="14062">SERVER-2276</key>
            <summary> Lost Data  while Master in Replica set went down</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="4">Incomplete</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="krishna">Krishna Maddireddy</reporter>
                        <labels>
                    </labels>
                <created>Wed, 22 Dec 2010 20:03:21 +0000</created>
                <updated>Tue, 29 May 2012 14:53:33 +0000</updated>
                            <resolved>Fri, 2 Sep 2011 04:47:31 +0000</resolved>
                                    <version>1.6.5</version>
                                                    <component>Replication</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="52122" author="eliot" created="Fri, 2 Sep 2011 04:47:31 +0000"  >&lt;p&gt;Sorry for the delay.&lt;br/&gt;
If you&apos;re not using getLastError, then there is no way to tell which data got to the server.&lt;br/&gt;
For important writes, you should getLastError with w=2 so you know its on 2 servers&lt;/p&gt;</comment>
                            <comment id="21734" author="krishna" created="Wed, 22 Dec 2010 20:56:01 +0000"  >&lt;p&gt;is the lost data stored some where in  unsafe mode?&lt;/p&gt;</comment>
                            <comment id="21733" author="krishna" created="Wed, 22 Dec 2010 20:54:50 +0000"  >&lt;p&gt;with 1.7.5, when a existing master goes down , the mongos can not access the cluster even though there was a active primary.&lt;/p&gt;


&lt;p&gt;&amp;gt; db.printShardingStatus()&lt;br/&gt;
Wed Dec 22 15:53:48 uncaught exception: error &lt;/p&gt;
{
        &quot;$err&quot; : &quot;mongos connectionpool: connect failed set1/localhost:30001,localhost:30002,localhost:30003 : connect failed to set set1/localhost:30001,localhost:30002,localhost:30003&quot;,
        &quot;code&quot; : 11002
}
&amp;gt; 

mongo@db6 [~]# mongo --port 30002
MongoDB shell version: 1.7.4
connecting to: 127.0.0.1:30002/test
set1:PRIMARY&amp;gt; db.isMaster()
{
        &quot;setName&quot; : &quot;set1&quot;,
        &quot;ismaster&quot; : true,
        &quot;secondary&quot; : false,
        &quot;hosts&quot; : [
                &quot;localhost:30002&quot;,
                &quot;localhost:30003&quot;,
                &quot;localhost:30001&quot;
        ],
        &quot;arbiters&quot; : [
                &quot;localhost:30005&quot;,
                &quot;localhost:30004&quot;
        ],
        &quot;maxBsonObjectSize&quot; : 16777216,
        &quot;ok&quot; : 1
}
set1:PRIMARY&amp;gt; 




&amp;gt; use demo_contacts
switched to db demo_contacts
&amp;lt;ng: &quot;This is test string to test mongodb sharding &quot;+i,email:&quot;test@yahoo.com&quot;,testcase:&quot;Test Case1&quot;}
&lt;p&gt;);&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;lt;ng: &quot;This is test string to test mongodb sharding &quot;+i,email:&quot;test@yahoo.com&quot;,testcase:&quot;Test Case1&quot;});&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;lt;ng: &quot;This is test string to test mongodb sharding &quot;+i,email:&quot;test@yahoo.com&quot;,testcase:&quot;Test Case1&quot;});&lt;br/&gt;
&amp;gt;&lt;br/&gt;
&amp;lt;tacts.save(&lt;/p&gt;
{aid:4, contact_id:i,test_string: &quot;This is test string to test mongodb sharding &quot;+i,email:&quot;test@yahoo.com&quot;}
&lt;p&gt;);&lt;br/&gt;
mongos connectionpool: connect failed set1/localhost:30001,localhost:30002,localhost:30003 : connect failed to set set1/localhost:30001,localhost:30002,localhost:30003&lt;br/&gt;
&amp;gt; db.contacts.count()&lt;br/&gt;
Wed Dec 22 15:51:40 uncaught exception: count failed: {&lt;br/&gt;
        &quot;assertion&quot; : &quot;mongos connectionpool: connect failed set1/localhost:30001,localhost:30002,localhost:30003 : connect failed to set set1/localhost:30001,localhost:30002,localhost:30003&quot;,&lt;br/&gt;
        &quot;assertionCode&quot; : 11002,&lt;br/&gt;
        &quot;errmsg&quot; : &quot;db assertion failure&quot;,&lt;br/&gt;
        &quot;ok&quot; : 0&lt;br/&gt;
}&lt;br/&gt;
&amp;gt;  &lt;/p&gt;</comment>
                            <comment id="21728" author="eliot" created="Wed, 22 Dec 2010 20:34:26 +0000"  >&lt;p&gt;Can you try with 1.7.5?&lt;/p&gt;

&lt;p&gt;Note that unless you call getLastError after every insert (or use safe mode in the drivers), on hardware failure a write may get lost.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 22 Dec 2010 20:34:26 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 24 weeks, 5 days 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>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 24 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10020"><![CDATA[Linux]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>krishna</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrijrr:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21537</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hriadz:</customfieldvalue>

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