[SERVER-58250] Inefficient usage of memory tracking map for $group and $setWindowFields Created: 02/Jul/21  Updated: 29/Oct/23  Resolved: 06/Jul/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.2, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Participants:
Linked BF Score: 0

 Description   

As part of SERVER-54664, the memory tracking for $group was refactored to get some code sharing with window functions. The new tracker uses a pattern such as this, which is inefficient since in the worst case it will need to access the map twice. Instead, we should use the returned result of try_emplace when updating the memory usage.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 20/Jul/21 ]

Author:

{'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-58250 Fix regression in $group due to memory tracking refactor
by using return value of try_emplace instead of reaccessing map

(cherry picked from commit e2395982273ecf05cb5dd9373ed106e025fb4916)
Branch: v5.0
https://github.com/mongodb/mongo/commit/c5c62f701a3dc6a9ce9d4656f7899cc13259ea70

Comment by Githook User [ 06/Jul/21 ]

Author:

{'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-58250 Fix regression in $group due to memory tracking refactor
by using return value of try_emplace instead of reaccessing map
Branch: master
https://github.com/mongodb/mongo/commit/e2395982273ecf05cb5dd9373ed106e025fb4916

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