[SERVER-28982] $currentDate modifiers should not use LogicalClock as source Created: 26/Apr/17  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: 3.5.6
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-18557 Change oplog OpTime format to raw 64b... Backlog
Related
related to SERVER-28766 Create CurrentDateNode Closed
Assigned Teams:
Query Execution
Operating System: ALL
Sprint: Sharding 2017-06-19
Participants:

 Description   

Esepcially when we switch the time to be purely logical.

Here are the instances in the code that needs to be fixed:

https://github.com/mongodb/mongo/blob/r3.5.6/src/mongo/db/ops/modifier_current_date.cpp#L232
https://github.com/mongodb/mongo/blob/r3.5.6/src/mongo/db/ops/modifier_object_replace.cpp#L61
https://github.com/mongodb/mongo/blob/r3.5.6/src/mongo/db/ops/insert.cpp#L170

Implementation should provide backwards compatible behavior where the generated Timestamps are always unique.



 Comments   
Comment by Asya Kamsky [ 31/Jul/20 ]

We're moving away from $currentDate since we added "$$NOW" to agg, is this ticket still relevant? SERVER-23656

Comment by Sheeri Cabral (Inactive) [ 09/Jan/20 ]

I feel the query team should determine whether subsystems using $currentDate should rely on it to be unique, and then we can figure out what to do from there. $currentDate modifiers should be based on actual clock, not logical clock.

Comment by Tess Avitabile (Inactive) [ 26/Jun/17 ]

If this work is done after SERVER-28766, be sure to change CurrentDateNode.

Comment by Misha Tyulenev [ 23/Jun/17 ]

While testing the changes realized that its not safe because there is no uniqueness guarantees. It may affect tools like mongooplog that insert currentDate into oplog.

Comment by Randolph Tan [ 26/Apr/17 ]

They should be using something that is closely tied to the physical clock of the server, like one of the ClockSource from the ServiceContext.

Comment by Misha Tyulenev [ 26/Apr/17 ]

renctan Can you please clarify what should be used instead?

Generated at Thu Feb 08 04:19:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.