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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: v1.3.1, mongodb-2.6
    • Component/s: manual
    • Environment:
    • Last comment by Customer:
      true
    • Actual Time:
      8

      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

            Assignee:
            kay.kim Kay Kim (Inactive)
            Reporter:
            linda.qin Linda Qin
            Participants:
            Last commenter:
            Jonathan Dahl Jonathan Dahl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              7 years, 23 weeks, 1 day ago
              Date of 1st Reply: