-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prototype int8range #129233
base: master
Are you sure you want to change the base?
prototype int8range #129233
Conversation
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 cockroachdb#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: cockroachdb#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]>
Epic: none Release note: None
@ZhouXing19 and @sambhav-jain-16, it's a bit of a hack, but I added you both as reviewers to this fake PR so that hopefully you'll get email notifications whenever someone pushes to the branch |
e31dd13
to
2d8489f
Compare
It looks like your PR touches SQL parser code but doesn't add or edit parser tests. Please make sure you add or edit parser tests if you edit the parser. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
80a3993
to
c1b1cb4
Compare
This reverts commit 82f4fb1.
Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
You might see panic after a while after executing: root@localhost:26259/defaultdb> CREATE TABLE ab (a INT PRIMARY KEY, b INT8RANGE); CREATE TABLE Time: 21ms total (execution 21ms / network 1ms) root@localhost:26259/defaultdb> CREATE INDEX ON ab (b); CREATE INDEX Time: 652ms total (execution 652ms / network 0ms) root@localhost:26259/defaultdb> INSERT INTO ab VALUES (1, '[2,3)'::int8range); INSERT 0 1
This reverts commit 74bc516.
We're building a prototype of range types for breather week! Starting with
int8range
.Informs: #27791