Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2777

Comment on: "manual/release-notes/2.6-upgrade.txt"

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • v1.3.1, mongodb-2.6
    • Affects Version/s: None
    • Component/s: manual
    • Environment:

      In the step 2 to downgrade from MongoDB 2.5.x user authorization model to MongoDB 2.4 model, it uses bulk upsert to copy content of admin.system.users to admin.system.new_users.

      var bulkUpsert = db.getSiblingDB("admin").system.new_users.initializeOrderedBulkOp();
      
      db.getSiblingDB("admin").system.users.find().forEach(
         function (userDoc) {
            bulkUpsert.find( { _id: userDoc._id } ).upsert().replaceOne( userDoc );
         }
      );
      
      var res = bulkUpsert.execute();
      print(tojson(res));
      

      However, in a sharded cluster, it only supports batch sizes of one and w:0 write concern for config writes. So the bulk upsert in step 2 would fail as below:

      admin@undefined> var res = bulkUpsert.execute();
      2014-02-24T10:18:27.245+1100 Error: batch failed, cannot aggregate results: invalid batch request for config write at src/mongo/shell/bulk_api.js:696
      

      It looks like we cannot use bulk upsert to copy the content of admin.system.users to admin.system.new_users. We need to update the document to provide another way to do this.

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            linda.qin@mongodb.com Linda Qin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              10 years, 8 weeks, 5 days ago