[SERVER-18754] distinct3.js uses the bulk API incorrectly Created: 30/May/15  Updated: 14/Apr/16  Resolved: 24/Jun/15

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

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-18868 Make startParallelShell() assert that... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Quint Iteration 5
Participants:

 Description   

The code evaluated in the parallel shell does not use the bulk API correctly.

var bulk = db.jstests_distinct3.initializeUnorderedBulkOp();
for( i = 0; i < 100; ++i ) {
    bulk.remove( { a:49 } );
    for( j = 0; j < 20; ++j ) {
        bulk.insert( { a:49, c:49, d:j } );
    }
    bulk.execute();
}

  1. It should be .find({a: 49}).remove() instead of .remove({a: 49}).
  2. A bulk operation cannot be reused, so bulk should be initialized inside the for loop.


 Comments   
Comment by Max Hirschhorn [ 24/Jun/15 ]

Resolved as part of SERVER-18868: https://github.com/mongodb/mongo/commit/dd0c8d73aad862770866a65f5494e51620edfc7e#diff-4f181af8fc4020ccaa4fd17b299307f0

Comment by Max Hirschhorn [ 30/May/15 ]

The test does not fail when run because the exit code of the mongo shell started by startParallelShell() is ignored.

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