[SERVER-43014] Timestamp(0,0) not filled in for _id field Created: 23/Aug/19  Updated: 27/Oct/23  Resolved: 09/Oct/19

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

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Bernard Gorman
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-13088 Note regarding Timestamp expansion is... Closed
Problem/Incident
is caused by SERVER-12349 Insert from update replaces {_id:Time... Closed
Related
related to SERVER-13695 Support $currentDate expression for i... Backlog
Operating System: ALL
Sprint: Query 2019-10-07, Query 2019-10-21
Participants:

 Description   

asdf:PRIMARY> db.foo.insert({_id: Timestamp(0,0)})
WriteResult({ "nInserted" : 1 })
asdf:PRIMARY> db.foo.insert({_id: 1, x: Timestamp(0,0)})
WriteResult({ "nInserted" : 1 })
asdf:PRIMARY> db.foo.insert({_id: 2, w: 1, x: Timestamp(0,0)})
WriteResult({ "nInserted" : 1 })
asdf:PRIMARY> db.foo.find()
{ "_id" : Timestamp(0, 0) }
{ "_id" : 1, "x" : Timestamp(1566529153, 1) }
{ "_id" : 2, "w" : 1, "x" : Timestamp(1566529173, 1) }

The documentation says "Changed in version 2.6: Previously, the server would only replace empty timestamp values in the first two fields, including _id, of an inserted document. Now MongoDB will replace any top-level field." So either the server or the docs have a bug. https://docs.mongodb.com/manual/reference/bson-types/#timestamps



 Comments   
Comment by David Storch [ 09/Sep/19 ]

Parking in the next iteration so we can investigate the following:

  • What versions does this affect? Is it a regression?
  • What's the complexity of the fix?
Generated at Thu Feb 08 05:02:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.