[SERVER-567] Assertion failure updating two fields atomically Created: 25/Jan/10  Updated: 12/Jul/16  Resolved: 25/Jan/10

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 1.3.1
Fix Version/s: 1.3.2

Type: Bug Priority: Major - P3
Reporter: Nick Kleinschmidt Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux x64, Mac OS x64


Participants:

 Description   

The following atomic update works on 1.3.0, but doesn't on 1.3.1.

1.3.0
> db.userdb.find()
> db.userdb.update(

{ "l" : 123 }

, { $set : { "v" :

{ "i" : 123, "a":456 }

}, $push :

{ "f" : 234}

}, 1, 0 );
> db.userdb.update(

{ "l" : 123 }

, { $set : { "v" :

{ "i" : 123, "a":456 }

}, $push :

{ "f" : 234}

}, 1, 0 );
> db.userdb.find()
{ "_id" : ObjectId("4b5df3d9b93fbafb88ecc49e"), "f" : [ 234, 234 ], "l" : 123, "v" :

{ "i" : 123, "a" : 456 }

}

1.3.1
> db.userdb.find()
> db.userdb.update(

{ "l" : 123 }

, { $set : { "v" :

{ "i" : 123, "a":456 }

}, $push :

{ "f" : 234}

}, 1, 0 );
> db.userdb.update(

{ "l" : 123 }

, { $set : { "v" :

{ "i" : 123, "a":456 }

}, $push :

{ "f" : 234}

}, 1, 0 );
can't apply mod in place - shouldn't have gotten here
> db.userdb.find()
{ "_id" : ObjectId("4b5df40fe57102386957a5ed"), "f" : [ 234 ], "l" : 123, "v" :

{ "i" : 123, "a" : 456 }

}



 Comments   
Comment by auto [ 25/Jan/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: test for SERVER-567
http://github.com/mongodb/mongo/commit/c4388ac021d74c7cbce90cee15ffc8e0e0d6e02b

Generated at Thu Feb 08 02:54:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.