[SERVER-45831] [4.0] Performance regression processing large aggregation commands Created: 28/Jan/20  Updated: 29/Oct/23  Resolved: 29/Jan/20

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

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by SERVER-43910 include Client/OpCtx information in L... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2020-02-10
Participants:
Linked BF Score: 0

 Description   

Due to the backport of SERVER-43910, all aggregation commands now call BSONObj::toString() via redact() on execution. For large BSON objects, this is a very expensive operation.

This performance regression will be most noticeable for large aggregation commands that execute quickly. This is not related to pipeline stages necessarily, but command object size. For example, $in on a large array will observe this regression.

This is caused by the absence of changes from SERVER-35912 in 4.0, which changed the inheritance of PipelineCommand from BasicCommand to Command. This performance regression does not exist in 4.2 and master because PipelineCommand does not inherit from BasicCommand, which calls into redact() and BSONObj::toString().



 Comments   
Comment by Benety Goh [ 29/Jan/20 ]

Removed command info from the LockManager DebugInfo field. See this commit:

Author:

{'username': 'benety', 'name': 'Benety Goh', 'email': 'benety@mongodb.com'}

Message: Revert "SERVER-43910 BasicCommand::Invocation sets LockManager DebugInfo"
This reverts commit 41981ad8d67b3fc95da21506751cc5d284e724e1.
Branch: v4.0
https://github.com/mongodb/mongo/commit/f718c0e820777c02af3577905876d63936a25d55

Generated at Thu Feb 08 05:09:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.