jstests/concurrency/fsm_workloads/insert_ttl_timeseries.js
/**
         * Writers are not restricted to insert documents for their thread id. Insert a batch with
         * randomized thread ids to exercise the case where a batch insert results in writes to
         * several different buckets.
         */
Writers are not restricted to insert documents for their thread id. Insert a batch with
randomized thread ids to exercise the case where a batch insert results in writes to
several different buckets.
Writers are not restricted to insert documents for their thread id . Insert a batch with randomized thread ids to exercise the case where a batch insert results in writes to several different buckets .
function insertManyRandTid(db, collName) {
            const coll = this.getCollection(db, collName);
            const docs = [];
            for (let i = 0; i < batchSize; i++) {
                docs.push({
                    [metaFieldName]: Random.randInt(this.threadCount),
                    [timeFieldName]: getTime(),
                    data: Random.rand(),
                });
            }
            const res = coll.insertMany(docs, {ordered: false});
            assertAlways.commandWorked(res);
            assertAlways.eq(res.insertedIds.length, batchSize);
        }
function insertManyRandTid ( db , collName ) { const coll = this . getCollection ( db , collName ) ; const docs = [ ] ; for ( let i = 0 ; i < batchSize ; i ++ ) { docs . push ( { [ metaFieldName ] : Random . randInt ( this . threadCount ) , [ timeFieldName ] : getTime ( ) , data : Random . rand ( ) , } ) ; } const res = coll . insertMany ( docs , { ordered : false } ) ; assertAlways . commandWorked ( res ) ; assertAlways . eq ( res . insertedIds . length , batchSize ) ; }
Writers are not restricted to insert documents for their thread id.
Writers are not restricted to insert documents for their thread id .