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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • v1.3.1, mongodb-2.6
    • None
    • manual

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 42 weeks ago