[SERVER-54565] date field gets flipped to "now" after set with $min in upsert Created: 13/Feb/21 Updated: 17/Mar/21 Resolved: 17/Mar/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.4.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Peter Billen | Assignee: | Edwin Zhou |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL | |||
| Steps To Reproduce: | Open shell and execute the three commands above in a fast manner:
Depending on timing, you get a correct or invalid value for the `scheduleAt` field.
|
|||
| Participants: |
| Description |
|
Consider the follow sequence of three commands:
When the last `find()` is executed immedeality, I get:
However, after waiting a second or more, I get for find():
Note that the `scheduledAt` field has been flipped to the current timestamp.
The idea of the update query above is to only update `scheduledAt` when the given value is less than the current value. Initially (during the insert), the given value should be taken. This seems to work fine with other data types (such as integer), but not for the date data type. See also https://imgur.com/a/iGzKrDn |
| Comments |
| Comment by Edwin Zhou [ 17/Mar/21 ] | ||||||||||||||||
|
We haven’t heard back from you for some time, so I’m going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket. Best, | ||||||||||||||||
| Comment by Edwin Zhou [ 08/Mar/21 ] | ||||||||||||||||
|
We still need additional information to diagnose the problem. If this is still an issue for you, would you please
Thanks, | ||||||||||||||||
| Comment by Edwin Zhou [ 16/Feb/21 ] | ||||||||||||||||
|
Thanks for providing a detailed reproduction for your issue. I am unable to reproduce the issue with my following script:
First and successive calls of coll.find({}) returns
Can you please:
Thanks, | ||||||||||||||||
| Comment by Peter Billen [ 13/Feb/21 ] | ||||||||||||||||
|
My apologies for the formatting in the reproduce steps, but apparently I cannot edit my ticket anymore. |