-
Notifications
You must be signed in to change notification settings - Fork 885
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
Use explicit memory context with hash_create #4534
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4534 +/- ##
==========================================
- Coverage 90.23% 90.19% -0.04%
==========================================
Files 222 222
Lines 41089 41088 -1
==========================================
- Hits 37076 37059 -17
- Misses 4013 4029 +16
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, LGTM. Two comments on the PR:
-
In my opinion, this PR (along with Fix memory leak in function telemetry #4532) should be mentioned in the changelog as a bug fix.
-
I was wondering if it would be possible to write a coccinelle test that automatically detects the missing memory contexts and
HASH_CONTEXT
flags?
4ebea69
to
2d4a23a
Compare
They should definitely be in changelog, i'll add them in release PR #4535. |
This changes the hash_create calls in the function cache and in the cagg code to use explicit memory context. Without this hash_create will create the hash table in TopMemoryContext potentially leading to memory leaks.
2d4a23a
to
41d4fe7
Compare
This release is a patch release. We recommend that you upgrade at the next available opportunity. Among other things this release fixes several memory leaks, handling of TOASTed values in GapFill and parameter handling in prepared statements. **Bugfixes** * timescale#4517 Fix prepared statement param handling in ChunkAppend * timescale#4522 Fix ANALYZE on dist hypertable for a set of nodes * timescale#4526 Fix gapfill group comparison for TOASTed values * timescale#4527 Handle stats properly for range types * timescale#4532 Fix memory leak in function telemetry * timescale#4534 Use explicit memory context with hash_create * timescale#4538 Fix chunk creation on hypertables with non-default statistics **Thanks** * @3a6u9ka, @bgemmill , @hongquani, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak * @hleung2021 and @laocaixw for reporting an issue with parameter handling in prepared statements
This release is a patch release. We recommend that you upgrade at the next available opportunity. Among other things this release fixes several memory leaks, handling of TOASTed values in GapFill and parameter handling in prepared statements. **Bugfixes** * timescale#4517 Fix prepared statement param handling in ChunkAppend * timescale#4522 Fix ANALYZE on dist hypertable for a set of nodes * timescale#4526 Fix gapfill group comparison for TOASTed values * timescale#4527 Handle stats properly for range types * timescale#4532 Fix memory leak in function telemetry * timescale#4534 Use explicit memory context with hash_create * timescale#4538 Fix chunk creation on hypertables with non-default statistics **Thanks** * @3a6u9ka, @bgemmill , @hongquani, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak * @hleung2021 and @laocaixw for reporting an issue with parameter handling in prepared statements
This release is a patch release. We recommend that you upgrade at the next available opportunity. Among other things this release fixes several memory leaks, handling of TOASTed values in GapFill and parameter handling in prepared statements. **Bugfixes** * timescale#4517 Fix prepared statement param handling in ChunkAppend * timescale#4522 Fix ANALYZE on dist hypertable for a set of nodes * timescale#4526 Fix gapfill group comparison for TOASTed values * timescale#4527 Handle stats properly for range types * timescale#4532 Fix memory leak in function telemetry * timescale#4534 Use explicit memory context with hash_create * timescale#4538 Fix chunk creation on hypertables with non-default statistics **Thanks** * @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak * @hleung2021 and @laocaixw for reporting an issue with parameter handling in prepared statements
This release is a patch release. We recommend that you upgrade at the next available opportunity. Among other things this release fixes several memory leaks, handling of TOASTed values in GapFill and parameter handling in prepared statements. **Bugfixes** * #4517 Fix prepared statement param handling in ChunkAppend * #4522 Fix ANALYZE on dist hypertable for a set of nodes * #4526 Fix gapfill group comparison for TOASTed values * #4527 Handle stats properly for range types * #4532 Fix memory leak in function telemetry * #4534 Use explicit memory context with hash_create * #4538 Fix chunk creation on hypertables with non-default statistics **Thanks** * @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak * @hleung2021 and @laocaixw for reporting an issue with parameter handling in prepared statements
This release is a patch release. We recommend that you upgrade at the next available opportunity. Among other things this release fixes several memory leaks, handling of TOASTed values in GapFill and parameter handling in prepared statements. **Bugfixes** * #4517 Fix prepared statement param handling in ChunkAppend * #4522 Fix ANALYZE on dist hypertable for a set of nodes * #4526 Fix gapfill group comparison for TOASTed values * #4527 Handle stats properly for range types * #4532 Fix memory leak in function telemetry * #4534 Use explicit memory context with hash_create * #4538 Fix chunk creation on hypertables with non-default statistics **Thanks** * @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak * @hleung2021 and @laocaixw for reporting an issue with parameter handling in prepared statements
This release is a patch release. We recommend that you upgrade at the next available opportunity. Among other things this release fixes several memory leaks, handling of TOASTed values in GapFill and parameter handling in prepared statements. **Bugfixes** * #4517 Fix prepared statement param handling in ChunkAppend * #4522 Fix ANALYZE on dist hypertable for a set of nodes * #4526 Fix gapfill group comparison for TOASTed values * #4527 Handle stats properly for range types * #4532 Fix memory leak in function telemetry * #4534 Use explicit memory context with hash_create * #4538 Fix chunk creation on hypertables with non-default statistics **Thanks** * @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak * @hleung2021 and @laocaixw for reporting an issue with parameter handling in prepared statements
This release is a patch release. We recommend that you upgrade at the next available opportunity. Among other things this release fixes several memory leaks, handling of TOASTed values in GapFill and parameter handling in prepared statements. **Bugfixes** * #4517 Fix prepared statement param handling in ChunkAppend * #4522 Fix ANALYZE on dist hypertable for a set of nodes * #4526 Fix gapfill group comparison for TOASTed values * #4527 Handle stats properly for range types * #4532 Fix memory leak in function telemetry * #4534 Use explicit memory context with hash_create * #4538 Fix chunk creation on hypertables with non-default statistics **Thanks** * @3a6u9ka, @bgemmill, @hongquan, @stl-leonid-kalmaev and @victor-sudakov for reporting a memory leak * @hleung2021 and @laocaixw for reporting an issue with parameter handling in prepared statements
This changes the hash_create calls in the function cache and in the
cagg code to use explicit memory context. Without this hash_create
will create the hash table in TopMemoryContext potentially leading
to memory leaks.