[SERVER-4940] capped collection replication dedups based on full object without an _id Created: 12/Feb/12  Updated: 03/Mar/15  Resolved: 23/Feb/15

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

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

Issue Links:
Related
is related to SERVER-4939 capped collection replication may fai... Closed
is related to SERVER-6984 Initial sync can fail, or break futur... Closed
is related to SERVER-8972 extent layout differences can cause i... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

It is possible to replicate a capped collection that is created without an _id index and without document _ids. In this case deduping on the slave is performed on the basis of complete documents rather than by _id. This means identical documents inserted to the master will not all be replicated to the slave.

Test will be pushed.



 Comments   
Comment by Eric Milkie [ 23/Feb/15 ]

It is no longer possible to insert documents without an _id field.
Collection replication is still broken for collections without an _id unique index, however.

Comment by auto [ 15/Mar/13 ]

Author:

{u'date': u'2013-03-15T10:17:01Z', u'name': u'aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-4940 Update the repl16 test so it will trigger the appropriate behavior in the current mongo shell.
Branch: master
https://github.com/mongodb/mongo/commit/e60c28a09c691a7c4d9447dab9347d15d85e5e39

Comment by Aaron Staple [ 17/Jan/13 ]

We don't always force an _id. Is doing so a functional goal?

#include <iostream>
 
#include "mongo/client/dbclient.h"
 
using namespace std;
using namespace mongo;
 
int main( int argc, const char **argv ) {
 
    const char *port = "27017";
    if ( argc != 1 ) {
        if ( argc != 3 ) {
            cout << "need to pass port as second param" << endl;
            return EXIT_FAILURE;
        }
        port = argv[ 2 ];
    }
 
    mongo::DBClientConnection conn;
    string errmsg;
    if ( ! conn.connect( string( "127.0.0.1:" ) + port , errmsg ) ) {
        cout << "couldn't connect : " << errmsg << endl;
        return EXIT_FAILURE;
    }
 
    BSONObj info;
    conn.runCommand( "db",
                     BSON( "create" << "coll" <<
                           "size" << 10000 <<
                           "capped" << true <<
                           "autoIndexId" << false ),
                     info );
 
    conn.insert( "db.coll", BSON( "a" << 1 ) );
 
    // No _id in this document.                                                           
    log() << conn.findOne( "db.coll", "" ) << endl;
 
}

Comment by Eliot Horowitz (Inactive) [ 17/Jan/13 ]

We now force an _id

Comment by auto [ 13/Feb/12 ]

Author:

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

Message: SERVER-4940 test
Branch: master
https://github.com/mongodb/mongo/commit/dffb612e61e7331bcb2b3343faa0bf2fcecd227d

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