[SERVER-71238] BSONObjectTooLarge Created: 10/Nov/22  Updated: 02/Dec/22  Resolved: 02/Dec/22

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

Type: Bug Priority: Major - P3
Reporter: Greg Cox Assignee: Yuan Fang
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-66289 $out incorrectly throws BSONObj size ... Closed
Operating System: ALL
Steps To Reproduce:

You can see this by running the function:
 
https://realm.mongodb.com/groups/61b9b3d63dd8550b4f8d43a2/apps/636a4655ccd4c6be4b82dc7d/functions/636d000304c811290ef1f726
 

Participants:

 Description   

Hi,

Error when running $merge into "atlas" from App Services trigger against MDB 5.0.13:
 

exports = async function() {
  
    const clusterName = "profilehub-test01-env02";
    const db = "profilehub-test01-env02";
    const dest_coll = "individualsAuditCOPY5";
  
    const client = context.services.get('FederatedDatabaseInstance0')
    const archiveCol = client.db(db).collection(dest_coll);
  
    try {
  
        const pipe = [{
          "$addFields": {
            "archived_date": new Date()
          }
        },{
          "$merge": {
            "into": {
              "atlas": {
                "projectId": "",
                "clusterName": clusterName,
                "db": db,
                "coll": dest_coll
              }
            }
          }
        }];
        
        await archiveCol.aggregate(pipe).toArray();
        
    } catch (err) {
        error = err;
        throw error;
    } finally {
      
    }
    
    return true;
    
  }; 

Produces

(BSONObjectTooLarge) PlanExecutor error during aggregation :: caused by :: BSONObj size: 17416355 (0x109C0A3) is invalid. Size must be between 0 and 16793600(16MB) First element: update: "individualsAuditCOPY5", correlationID = 17263d8e56dfeb8b8c5deee3

This only occurs when total size of ALL documents to update is >16MB so is this related to:
https://jira.mongodb.org/browse/SERVER-68845
 
Testing against MDB 4.4.17 does not produce this error

Note that individual documents are <16MB even with update of adding extra field



 Comments   
Comment by Yuan Fang [ 02/Dec/22 ]

greg.cox@mongodb.com Thank you for confirming this. I'm closing this ticket as the issue was fixed.

Comment by Greg Cox [ 02/Dec/22 ]

yuan.fang@mongodb.com - I can confirm this issue was fixed in the 5.0.14 release - you can now close this

Comment by Yuan Fang [ 18/Nov/22 ]

greg.cox@mongodb.com, here are some useful links:

  • Jira dashboard that I use to check upcoming MongoDB releases.
  • STAR-3188 is for MongoDB 5.0.14 release that you can use to track the progress. The release to Atlas is typically 3 days later.
Comment by Greg Cox [ 18/Nov/22 ]

Thanks yuan.fang@mongodb.com Out of interest is there a link to those release dates you can share ?

Comment by Yuan Fang [ 17/Nov/22 ]

Hi, greg.cox@mongodb.com Just spoke with my team, Atlas is currently set to start the rollout of 5.0.14 on 11/21/2022. We currently don't have a clear answer about how to get a private cluster on the unreleased version, guess you don't but let us know if you need help figuring it out.

Comment by Greg Cox [ 17/Nov/22 ]

Hi yuan.fang@mongodb.com -

I cannot replicate the same on prem as we are using $merge into "atlas". I have tried a standard $merge with on prem 5.0.8/5.0.13.5.0.14 and all no issues so we need to try this on Atlas.

If i spin up a 4.4.17 cluster on Atlas then no issue but 5.0.13 fails as per above

  1. Do you have a release date for 5.0.14 on Atlas ?
  2. If its not for a few weeks, is there a way we can get a private cluster on this version to test ?
Comment by Yuan Fang [ 17/Nov/22 ]

greg.cox@mongodb.com 5.0.14-rc0 is released and can be downloaded here.

Comment by Greg Cox [ 17/Nov/22 ]

It look similar but I wanted to confirm the fix in 5.0.14 will apply to $merge into "atlas". Is there a way I can test against 5.0.14 ? i.e. can we get access to this release ?

Generated at Thu Feb 08 06:18:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.