[CSHARP-770] Make Server time available through Collection / Server objects Created: 30/Jun/13 Updated: 20/Mar/14 Resolved: 01/Jul/13 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.6 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Curt Mayers | Assignee: | Sridhar Nanjundeswaran |
| Resolution: | Done | Votes: | 0 |
| Labels: | multiuser, sequencing, server, time, timestamp | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
All |
||
| Description |
|
It would be useful if the driver were able to return the database server's current time as a DateTime. Counting on a client machine's internal clock is unreliable, and there are many cases where a single, definitive time source is much more appropriate Possible uses: Where machines are clustered, this call should always be satisfied from the "primary" machine, or arbiter. |
| Comments |
| Comment by Curt Mayers [ 09/Jul/13 ] |
|
I'll do that. Thanks for your patience. Curt On Fri, Jul 5, 2013 at 3:20 PM, Sridhar Nanjundeswaran (JIRA) < |
| Comment by Sridhar Nanjundeswaran [ 05/Jul/13 ] |
|
Hi Curt, |
| Comment by Curt Mayers [ 02/Jul/13 ] |
|
The point is not to get an accurate time, it's to get a *consisten*t time. I'm sure that you are well aware that--in all but a web or online service That is why every commercial database engine on the market has a way of You can certainly make it a requirement of cluster configuration that the I hope you'll think about this some, because it would solve a lot of Thanks, On Tue, Jul 2, 2013 at 4:22 PM, Sridhar Nanjundeswaran (JIRA) < |
| Comment by Sridhar Nanjundeswaran [ 02/Jul/13 ] |
|
Hi Curt, Even if you could get the server time how would you account for network delay to find the actual time? To clarify your point 4 In both these cases we are still not considering the case of authenticated clusters where you may not have access to some "canonical database" 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 |
| Comment by Curt Mayers [ 01/Jul/13 ] |
|
I don't think this is an adequate solution: 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. 2. Most of the use cases I suggested (e.g. filling in "last updated date" 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. 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'm familiar has a way of referencing the server time for such needs. 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. |
| Comment by Sridhar Nanjundeswaran [ 01/Jul/13 ] |
|
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. |