<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:46 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>[CSHARP-770] Make Server time available through Collection / Server objects</title>
                <link>https://jira.mongodb.org/browse/CSHARP-770</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;It would be useful if the driver were able to return the database server&apos;s current time as a DateTime.   Counting on a client machine&apos;s internal clock is unreliable, and there are many cases where a single, definitive time source is much more appropriate&lt;/p&gt;

&lt;p&gt;Possible uses:&lt;br/&gt;
  Create / update timestamps in records.&lt;br/&gt;
  Calculation of elapsed time since a recorded datetime&lt;br/&gt;
  Sequencing incoming records coming from multiple client machines&lt;br/&gt;
  Rationalizing updates coming from different time zones.&lt;/p&gt;

&lt;p&gt;Where machines are clustered, this call should always be satisfied from the &quot;primary&quot; machine, or arbiter.&lt;/p&gt;</description>
                <environment>All</environment>
        <key id="80832">CSHARP-770</key>
            <summary>Make Server time available through Collection / Server objects</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="9">Done</resolution>
                                        <assignee username="sridhar">Sridhar Nanjundeswaran</assignee>
                                    <reporter username="curt">Curt Mayers</reporter>
                        <labels>
                            <label>multiuser</label>
                            <label>sequencing</label>
                            <label>server</label>
                            <label>time</label>
                            <label>timestamp</label>
                    </labels>
                <created>Sun, 30 Jun 2013 23:40:38 +0000</created>
                <updated>Thu, 20 Mar 2014 14:37:13 +0000</updated>
                            <resolved>Mon, 1 Jul 2013 22:39:31 +0000</resolved>
                                    <version>1.6</version>
                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="376721" author="curt" created="Tue, 9 Jul 2013 00:46:23 +0000"  >&lt;p&gt;I&apos;ll do that.&lt;/p&gt;

&lt;p&gt;Thanks for your patience.&lt;/p&gt;

&lt;p&gt;Curt&lt;/p&gt;


&lt;p&gt;On Fri, Jul 5, 2013 at 3:20 PM, Sridhar Nanjundeswaran (JIRA) &amp;lt;&lt;/p&gt;
</comment>
                            <comment id="374960" author="sridhar" created="Fri, 5 Jul 2013 22:15:58 +0000"  >&lt;p&gt;Hi Curt,&lt;br/&gt;
Thanks for your comments and patience. IMHO this is not a feature that should be provided by the driver without support from the database server. I would recommend filing a core server ticket. We can then link this ticket to the core server ticket.&lt;/p&gt;</comment>
                            <comment id="373013" author="curt" created="Tue, 2 Jul 2013 23:40:06 +0000"  >&lt;p&gt;The point is not to get an &lt;b&gt;accurate&lt;/b&gt; time, it&apos;s to get a *consisten*t time.&lt;/p&gt;

&lt;p&gt;I&apos;m sure that you are well aware that--in all but a web or online service&lt;br/&gt;
scenario--control of client machines is not within the developer&apos;s hands,&lt;br/&gt;
and is out of his control.  In fact, the *only *thing that clients will&lt;br/&gt;
have in common, in many situations is a connection to the server.   They&lt;br/&gt;
may sit in different organizations, in different timezones, on different&lt;br/&gt;
platforms, etc.&lt;/p&gt;

&lt;p&gt;That is why every commercial database engine on the market has  a way of&lt;br/&gt;
retrieving the server&apos;s time, and/or a set of tokens or functions for&lt;br/&gt;
inserting the current time into a record.&lt;/p&gt;

&lt;p&gt;You can certainly make it a requirement of cluster configuration that the&lt;br/&gt;
machines share a common times server, or designate a single machine as the&lt;br/&gt;
reference.   But the idea that you can&apos;t account for differing network&lt;br/&gt;
latencies, or differences among machines within a service cluster (which is&lt;br/&gt;
at least potentially under someone&apos;s controls) are secondary to the need&lt;br/&gt;
for a definitive time source.&lt;/p&gt;

&lt;p&gt;I hope you&apos;ll think about this some, because it would solve a lot of&lt;br/&gt;
potential problems, and do it in the most straightforward, consistent, and&lt;br/&gt;
uniform way available.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Curt&lt;/p&gt;


&lt;p&gt;On Tue, Jul 2, 2013 at 4:22 PM, Sridhar Nanjundeswaran (JIRA) &amp;lt;&lt;/p&gt;
</comment>
                            <comment id="372962" author="sridhar" created="Tue, 2 Jul 2013 22:25:30 +0000"  >&lt;p&gt;Hi Curt, &lt;br/&gt;
You do need NTP setup for at least the machines that are part of the MongoDB Cluster. Hence if you extend this to the client machine, you can get the time from the client locally as opposed to going to the server to get it.&lt;/p&gt;

&lt;p&gt;Even if you could get the server time how would you account for network delay to find the actual time?&lt;/p&gt;

&lt;p&gt;To clarify your point 4&lt;br/&gt;
for replica sets there is no single arbiter/master. Each machine is equivalent to another. If you are thinking about the mongodb arbiter there is nothing that stops you from having more than one arbiter in a replica set cluster.&lt;br/&gt;
In the case of the sharded cluster, you could assume the source of truth is a config server but there are 3 of them. Which would you choose?&lt;/p&gt;

&lt;p&gt;In both these cases we are still not considering the case of authenticated clusters where you may not have access to some &quot;canonical database&quot; to provide such a functionality. Hope this clarifies why we recommend using NTP for getting time and there is no direct core server support for this&lt;/p&gt;</comment>
                            <comment id="372082" author="curt" created="Mon, 1 Jul 2013 22:52:34 +0000"  >&lt;p&gt;I don&apos;t think this is an adequate solution:&lt;/p&gt;

&lt;p&gt;1.  The time resolution of multiple machines subscribing to a time server is not accurate enough for many of the needs that I suggested that a server time would be useful for.&lt;/p&gt;

&lt;p&gt;2.  Most of the use cases I suggested (e.g. filling in &quot;last updated date&quot; in records) will take place on client machines;  and no one has sufficient control over software client apps to ensure that all parties not only subscribe to a NTP server, but the same one, and with a common resolution.&lt;/p&gt;

&lt;p&gt;3.  Even if all of the machines participating in a Mongo cluster DID use a common time server, it means that the developer must design a second channel, and a separate service and server to pass time information back from the server.   Every other enterprise database with which I&apos;m familiar has a way of referencing the server time for such needs.&lt;/p&gt;

&lt;p&gt;4.  In the two cases that you suggested in points 2 and 3, you return the case of the arbiter in a cluster set, or the current primary in a replica set.&lt;/p&gt;</comment>
                            <comment id="372069" author="sridhar" created="Mon, 1 Jul 2013 22:39:31 +0000"  >&lt;p&gt;The correct way of doing this is to set up NTP on your database node(s) and client/app server machines. This way the clocks are in sync and you can use the time from your client/app server. &lt;br/&gt;
The problem with server time is, what is server time in a cluster?&lt;br/&gt;
1) In case of a single standalone server it is just that server&apos;s time. Even in this case since you do not know how long the query took, you do not know what is the actual server time&lt;br/&gt;
2) In the case of replica sets, which member&apos;s time are we talking about? Simple assumption is that it is the primary&apos;s. What if there is no primary when you request server time?&lt;br/&gt;
3) In the case of a sharded cluster, is server time, the time of the mongos you are connected to?&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrrfgv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>73890</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>