[SERVER-65473] Fix another location of memory tracking underflow Created: 12/Apr/22  Updated: 29/Oct/23  Resolved: 04/May/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

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

Attachments: File agg_fuzzer-fbdb-1646788855977-2.js    
Issue Links:
Depends
Related
is related to SERVER-62283 Temporary workaround of the problem i... Closed
is related to SERVER-61281 Fix underflow when accounting for Doc... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2022-04-18, QE 2022-05-02, QE 2022-05-16
Participants:
Linked BF Score: 120

 Description   

Memory tracking underflow can also happen here:

https://github.com/mongodb/mongo/blob/e7544180078415f6dd6bce44b90033f2599abf52/src/mongo/db/pipeline/memory_usage_tracker.h#L157

Previously this place is patched to prevent the underflow from happening:

https://github.com/mongodb/mongo/blob/e7544180078415f6dd6bce44b90033f2599abf52/src/mongo/db/pipeline/memory_usage_tracker.h#L54

The same fix should be applied to the first location as well.



 Comments   
Comment by Githook User [ 03/May/22 ]

Author:

{'name': 'Rushan Chen', 'email': 'rushan.chen@mongodb.com', 'username': 'ruchen'}

Message: SERVER-65473 stop underflow assert in global memory tracker
Branch: master
https://github.com/mongodb/mongo/commit/a703f5048141ff87446cfdce9b127bfa2914e5a9

Comment by Rushan Chen [ 13/Apr/22 ]

This BF is caused by the same underpinning issue of inaccurate memory tracking. Memory tracking itself is hard to track to uncover where the inaccuracy takes place. So to avoid any tripwire assert (and query failure), for the current master (6.0) and 5.3 versions, the same fix as in SERVER-62283 is adopted.

Note that there has been no report of BFs for master and 5.3. But the tripwire assert issue can be reproduced by running the following command (test file is attached):

./buildscripts/resmoke.py run --suites=generational_fuzzer  agg_fuzzer-fbdb-1646788855977-2.js   agg_fuzzer-fbdb-1646788855977-2.js

 

 

 

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