<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:21:17 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-9728] Is there any specific way (calculation) to check replication lag.</title>
                <link>https://jira.mongodb.org/browse/SERVER-9728</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;      I have found in MongoDB documentation that &quot;An ISODate formatted date string that reflects the last entry from the oplog that this member applied. If this differs significantly from lastHeartbeat this member is either experiencing &#8220;replication lag&#8221; or there have not been any new operations since the last update&quot;&lt;/p&gt;

&lt;p&gt;       My question is,Is there any particular calculation or some thing else through which I can measure replication lag.&lt;/p&gt;

&lt;p&gt;        Below is the statics on basis of that I want to check any Replication Lag.&lt;/p&gt;

&lt;p&gt;&quot;members&quot; : [&lt;br/&gt;
        {&lt;/p&gt;

&lt;p&gt;                &quot;health&quot; : 1,&lt;br/&gt;
                &quot;state&quot; : 2,&lt;br/&gt;
                &quot;stateStr&quot; : &quot;SECONDARY&quot;,&lt;br/&gt;
                &quot;uptime&quot; : 1137376,&lt;br/&gt;
                &quot;optime&quot; : &lt;/p&gt;
{
                        &quot;t&quot; : 1369035838,
                        &quot;i&quot; : 2
                }
&lt;p&gt;,&lt;br/&gt;
                &quot;optimeDate&quot; : ISODate(&quot;2013-05-20T07:43:58Z&quot;),&lt;br/&gt;
                &quot;lastHeartbeat&quot; : ISODate(&quot;2013-05-20T11:41:24Z&quot;),&lt;br/&gt;
                &quot;lastHeartbeatRecv&quot; : ISODate(&quot;2013-05-20T11:41:25Z&quot;),&lt;br/&gt;
                &quot;pingMs&quot; : 0,&lt;/p&gt;

&lt;p&gt;        },&lt;br/&gt;
        {&lt;br/&gt;
                &quot;_id&quot; : 1,&lt;br/&gt;
                &quot;health&quot; : 1,&lt;br/&gt;
                &quot;state&quot; : 1,&lt;br/&gt;
                &quot;stateStr&quot; : &quot;PRIMARY&quot;,&lt;br/&gt;
                &quot;uptime&quot; : 1139161,&lt;br/&gt;
                &quot;optime&quot; : &lt;/p&gt;
{
                        &quot;t&quot; : 1369035838,
                        &quot;i&quot; : 2
                }
&lt;p&gt;,&lt;br/&gt;
                &quot;optimeDate&quot; : ISODate(&quot;2013-05-20T07:43:58Z&quot;),&lt;br/&gt;
                &quot;self&quot; : true&lt;br/&gt;
        },&lt;br/&gt;
        {&lt;br/&gt;
                &quot;_id&quot; : 2,&lt;br/&gt;
                &quot;health&quot; : 1,&lt;br/&gt;
                &quot;state&quot; : 2,&lt;br/&gt;
                &quot;stateStr&quot; : &quot;SECONDARY&quot;,&lt;br/&gt;
                &quot;uptime&quot; : 1137376,&lt;br/&gt;
                &quot;optime&quot; : &lt;/p&gt;
{
                        &quot;t&quot; : 1369035838,
                        &quot;i&quot; : 2
                }
&lt;p&gt;,&lt;br/&gt;
                &quot;optimeDate&quot; : ISODate(&quot;2013-05-20T07:43:58Z&quot;),&lt;br/&gt;
                &quot;lastHeartbeat&quot; : ISODate(&quot;2013-05-20T11:41:24Z&quot;),&lt;br/&gt;
                &quot;lastHeartbeatRecv&quot; : ISODate(&quot;1970-01-01T00:00:00Z&quot;),&lt;br/&gt;
                &quot;pingMs&quot; : 0,&lt;/p&gt;

&lt;p&gt;        }&lt;br/&gt;
],    &lt;/p&gt;


&lt;p&gt;Thanks&lt;br/&gt;
MANISH&lt;/p&gt;
</description>
                <environment></environment>
        <key id="75884">SERVER-9728</key>
            <summary>Is there any specific way (calculation) to check replication lag.</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="manish@circarconsulting.com">Manish</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 May 2013 11:43:41 +0000</created>
                <updated>Wed, 10 Dec 2014 23:11:46 +0000</updated>
                            <resolved>Mon, 20 May 2013 12:09:23 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="416206" author="dan@10gen.com" created="Mon, 2 Sep 2013 13:45:31 +0000"  >&lt;p&gt;printSlaveReplicationInfo() is comparing the optimes of the secondary to the primary, not current time. The output of the command is confusing, which is why it was changed to be more clear with this ticket: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-7800&quot; title=&quot;Fix &amp;quot;db.printSlaveReplicationInfo()&amp;quot; command in mongo shell, for replica sets.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-7800&quot;&gt;&lt;del&gt;SERVER-7800&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Output now looks like this:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;name:SECONDARY&amp;gt; db.printSlaveReplicationInfo()&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;source: Daniels-MacBook-Air-2.local:31001&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;	syncedTo: Mon Sep 02 2013 09:28:47 GMT-0400 (EDT)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;	0 secs (0 hrs) behind the primary&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="414618" author="sumeet.x.sharma.-nd@disney.com" created="Fri, 30 Aug 2013 06:00:18 +0000"  >&lt;p&gt;The printSlaveReplicationInfo() represents how far behind the secondaries are from the *&lt;b&gt;currentTime&lt;/b&gt;*. &lt;/p&gt;

&lt;p&gt;This is slightly misleading coz if there is no operation, rs.status().members.optimeDate doesnot update. Causing the optimeDate - now() to reflect a large number even though slaves are not out of date from primary. Wrote a function to compare the primary(as Eliot mentioned):&lt;/p&gt;

&lt;p&gt;function getReplicationLag() {&lt;br/&gt;
primary=[];&lt;br/&gt;
secondary={};&lt;br/&gt;
rs.status().members.map(function(a){if(a.state==1)&lt;/p&gt;
{primary.push(a.optimeDate);}
&lt;p&gt; else {secondary&lt;span class=&quot;error&quot;&gt;&amp;#91;a.name&amp;#93;&lt;/span&gt;=a.optimeDate;}} );&lt;br/&gt;
for (var i in secondary)&lt;/p&gt;
{
   print(i +&quot; is &quot;+(secondary[i]-primary[0])/1000+&quot; seconds behind primary&quot;);
  }
&lt;p&gt;}&lt;br/&gt;
Eliot, please let me know if we can either modify the printSlaveReplicationInfo ?&lt;/p&gt;</comment>
                            <comment id="339689" author="eliot" created="Mon, 20 May 2013 12:09:16 +0000"  >&lt;p&gt;You just need to compare the optime on a secondary to the primary.&lt;/p&gt;

&lt;p&gt;So if you look at the optimes above, you&apos;ll see that the are the same for all nodes, so there is no lag.&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>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 20 May 2013 12:09:16 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            10 years, 24 weeks, 2 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="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>dan@mongodb.com</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>manish@circarconsulting.com</customfieldvalue>
            <customfieldvalue>sumeet.x.sharma.-nd@disney.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmslb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>53624</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|ht00wf:</customfieldvalue>

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