[SERVER-39932] SessionRuntimeInfo memory is not being released Created: 01/Mar/19  Updated: 29/Oct/23  Resolved: 21/Mar/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.6.11
Fix Version/s: 3.6.12

Type: Bug Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Misha Tyulenev
Resolution: Fixed Votes: 4
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2019-03-12 at 5.00.12 PM.png    
Issue Links:
Problem/Incident
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2019-03-11, Sharding 2019-03-25
Participants:
Case:

 Description   

The issue manifests as a steady increase in memory use from the _getOrCreateSessionRuntimeInfo.

The code in 3.6 shows that the memory is not released.
Only 3.6 release needs the fix, 4.0 and master are not affected



 Comments   
Comment by Githook User [ 20/Mar/19 ]

Author:

{'email': 'misha@mongodb.com', 'name': 'Misha Tyulenev', 'username': 'mikety'}

Message: SERVER-39932 do not checkout session if retriable writes are not used
Branch: v3.6
https://github.com/mongodb/mongo/commit/1144316212453346cb17ae0992542b192755ae04

Comment by Kaloian Manassiev [ 05/Mar/19 ]

Each SessionRuntimeInfo from the SessionsCatalog corresponds to a session with an active transaction on it. These entries get purged when entries get deleted from config.transactions (which is done by the sessions reaper). Is it possible that the sessions reaper is not deleting entries from config.transactions?

Another possibility that I am thinking of is that if an operation checks-out a session, but doesn't perform a retryable write (or it doesn't commit), there will not be an entry in config.transactions for the reaper to clean-up and therefore that entry will remain in memory forever, even if the session gets abandoned without ever having done a write.

Comment by Misha Tyulenev [ 04/Mar/19 ]

kelsey.schubert while the catalog sessions code changed since 3.6 the other releases are also affected with the same issue.

Comment by Misha Tyulenev [ 04/Mar/19 ]

josef.ahmad primary step down should release the memory, so the workaround I can think if is to force election periodically

Comment by Kelsey Schubert [ 01/Mar/19 ]

misha.tyulenev, could you confirm that only MongoDB 3.6 is affected?

Generated at Thu Feb 08 04:53:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.