-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
128400: sqlstats/insights: fix mem leaks on session close r=xinhaoz a=xinhaoz insights: ensure releasing to Insight pool clears slice Ensure that when we return objects into the Insight pool that we release the statmeents in the slice. This fixes an issue in the logic that returned this object to the pool which did not nil the `Statements` slice, making it possible for these slices to grow in capacity in the node's lifetime, holding onto garbage Statement objects. This is a lead up to #128199 which will likely remove this pool and reuse the existing statmentBuf pool. Epic: none Release note: None insights: add testing knobs Add insights specific testing knobs. We'll add some knobs in later commts. Epic: none Release note: None sqlstats/insights: free memory allocated per session on session close The insights locking registry buffers statement insight objects by session id until receiving a transaction insight, when the buffer is emptied. These buffers can leak if the session is closed midway through a transaction since the registry will never receive a transaction event for the session. This commit ensures we clear any memory allocated in insights for a session by sending an event to clear the container's session entry, if it exists, on session close. A testing knob was added, OnCloseSession, which is called when the locking registry clears a session. Epic: none Fixes: #128213 Release note (bug fix): Fixes a memory leak where statement insight objects may leak if the session is closed without the transaction finishing. insights: move insights testing knobs from sqlstats Move some insights testing knobs that were on the sqlstats testing knobs to insights pkg. Epic: none Release note: None Co-authored-by: Xin Hao Zhang <[email protected]>
- Loading branch information
Showing
21 changed files
with
221 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.