[SERVER-48230] fix oplog cursor leak in getEarliest/LatestOplogTimestamp() Created: 14/May/20  Updated: 29/Oct/23  Resolved: 15/May/20

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.4.0-rc7, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Daniel Gottlieb (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2020-05-14 at 9.24.21 PM.png    
Issue Links:
Backports
Duplicate
is duplicated by WT-6188 Memory leak in WiredTiger Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-05-18
Participants:

 Description   

WiredTigerRecordStore::getLatestOplogTimestamp() and WiredTigerRecordStore::getEarliestOplogTimestamp() open a new cursor every time they are called. This should be switched to using the cached cursor functionality provided in WiredTigerCursor.



 Comments   
Comment by Mark Callaghan (Inactive) [ 29/May/20 ]

I can't reproduce memory leaks in rc7 while I could in rc6 using IO-bound insert benchmark. This is good news.

Comment by Githook User [ 15/May/20 ]

Author:

{'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'username': 'dgottlieb'}

Message: SERVER-48230: Release cursor resources for special oplog functions.

(cherry picked from commit 0553eb750667692d25959c3b080156a6117789cf)
Branch: v4.4
https://github.com/mongodb/mongo/commit/903e5c1fc671614575b54481e67f12219cbb8d74

Comment by Githook User [ 15/May/20 ]

Author:

{'name': 'Daniel Gottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'username': 'dgottlieb'}

Message: SERVER-48230: Release cursor resources for special oplog functions.
Branch: master
https://github.com/mongodb/mongo/commit/0553eb750667692d25959c3b080156a6117789cf

Comment by Daniel Gottlieb (Inactive) [ 15/May/20 ]

Demonstration of the fix on 1,000 transactions (calls to getLatestOplogTimestamp). Left is pre-fix, right is post-fix:

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