[SERVER-12302] Breaking Change: Timestamp(0,0) now replaced on insert Created: 09/Jan/14  Updated: 14/Jan/14  Resolved: 09/Jan/14

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

Type: Bug Priority: Minor - P4
Reporter: Shaun Verch Assignee: Unassigned
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-12349 Insert from update replaces {_id:Time... Closed
Participants:

 Description   

> db.test.drop()
true
> db.test.insert({ "NumberInt" : NumberInt(0), "Timestamp" : Timestamp(0, 0) })
> db.test.insert({ "Timestamp" : Timestamp(0, 0) })
> db.test.find()
{ "_id" : ObjectId("52cdf6870449e37d1e934214"), "NumberInt" : 0, "Timestamp" : Timestamp(0, 0) }
{ "_id" : ObjectId("52cdf6890449e37d1e934215"), "Timestamp" : Timestamp(1389229705, 1) }
>

This causes things like the Timestamp not round tripping correctly doing a dump restore from 2.4 to 2.5 (this bug does not exist in 2.5)



 Comments   
Comment by Shaun Verch [ 09/Jan/14 ]

The way I found this issue was by doing dump/restore testing from 2.4 to 2.5. In 2.5 we replace the Timestamp even if it is not the first field.

Comment by Scott Hernandez (Inactive) [ 09/Jan/14 ]

This is by design; is there some use-case or test this is failing because of this?

On insert we now fill in all TimeStamp(0,0) with a server generated one. Before we only did so if the field was the 1st/2nd (including _id which is first) one.

Generated at Thu Feb 08 03:28:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.