[SERVER-4777] 'weird case' assertion when mods on two nested fields are applied to a document with a duplicated field name Created: 25/Jan/12  Updated: 11/Jul/16  Resolved: 16/Feb/12

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 2.0.5, 2.1.1

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Aaron Staple
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-4782 duplicate doc fields incorrectly gene... Closed
Duplicate
is duplicated by SERVER-4078 Assertion failure 0 db/ops/update.cpp... Closed
Related
related to SERVER-4776 improper application of modifiers wit... Closed
Operating System: ALL
Participants:

 Description   

                else {
                    // this is a very weird case
                    // have seen it in production, but can't reproduce
                    // this assert prevents an inf. loop
                    // but likely isn't the correct solution
                    assert(0);
                }



 Comments   
Comment by auto [ 20/Apr/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-4777 avoid 'weird case' assertion on modifier update with duplicate field names by applying updates to the first duplicate field provided by BSONObjIteratorSorted and passing through the remaining duplicates
Branch: v2.0
https://github.com/mongodb/mongo/commit/6477fd1d758682aadd0ef9789e449b85cd8be241

Comment by auto [ 07/Feb/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-4777 massert rather than assert
Branch: master
https://github.com/mongodb/mongo/commit/a3147b4cf2a8abf94d5eb420252beee6355fd01e

Comment by auto [ 07/Feb/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-4777 avoid 'weird case' assertion on modifier update with duplicate field names by applying updates to the first duplicate field provided by BSONObjIteratorSorted and passing through the remaining duplicates
Branch: master
https://github.com/mongodb/mongo/commit/e5d3da81edd6d094678afa6a93a761389c2b2702

Comment by auto [ 07/Feb/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-4777 test
Branch: master
https://github.com/mongodb/mongo/commit/a4f471953d6c1ce8f615dbfdb2999afb29a0654c

Comment by auto [ 07/Feb/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-4777 test
Branch: master
https://github.com/mongodb/mongo/commit/f5f171a0b41db08c122844aacaf81fb9be5f0240

Comment by Aaron Staple [ 25/Jan/12 ]

Here's the test, push pending bb code freeze

 
    class TwoModsWithinDuplicatedField : public SetBase {
    public:
        void run() {
            client().insert( ns(), BSON( "a" << BSONObj() << "a" << BSONObj() ) );
            client().update( ns(), BSONObj(), BSON( "$set" << BSON( "a.b" << 1 << "a.c" << 1 ) ) );
            ASSERT( error() ); // descriptive test, not sure of correct behavior yet SERVER-4777
        }
    };
 

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