Skip to content

Turn off JIT for only monitoring user's context #3384

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

Merged
merged 1 commit into from
Sep 27, 2022
Merged

Turn off JIT for only monitoring user's context #3384

merged 1 commit into from
Sep 27, 2022

Conversation

chobostar
Copy link
Contributor

@chobostar chobostar commented Sep 19, 2022

Dear, maintainers!

Thanks you for this operator and accumulation a lot of useful expertise around the best practices inside it. I bring a small improvement to the existing solution against memory leaks. Here it is.


It prevents issues related to monitoring queries:

  • slow query executing due to unnecessary inlining, optimization and emission
  • memory leak due to re-creating struct types during inlining

related issues (CrunchyData/crunchy-containers#1381) (CrunchyData/pgmonitor#182)

On the other hand database is open to enabling JIT for other users

Signed-off-by: Kirill Petrov chobostar85@gmail.com

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • New feature
  • Bug fix
  • Documentation
  • Testing enhancement
  • Other

What is the current behavior (link to any open issues here)?

I believe that relevant discussions around JIT's memory leak is here: https://www.postgresql.org/message-id/20210417021602.7dilihkdc7oblrf7%40alap3.anarazel.de

The issue currently occurs atleast on Postgres 12.

Currently JIT is disabled in whole database: CrunchyData/crunchy-containers#1309

It's not transparent for other database users and in the case of enabling JIT, one can face memory leaks and performance issues again.

What is the new behavior (if this is a feature change)?

  • Breaking change (fix or feature that would cause existing functionality to change)

Disabling JIT in ccp_monitoring's context is more explicit than current approach, thus I hope it safer for plain PGO users and obvious for PGO developers.

Other Information:

Copy link
Member

@cbandy cbandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. KUTTL tests don't yet run in GH actions, so I'll merge after I get a chance to run the test. Thanks!

It prevents issues related to monitoring queries:
- slow query executing due to unnecessary inlining, optimization and emission
- memory leak due to re-creating struct types during inlining
related issues (CrunchyData/crunchy-containers#1381) (CrunchyData/pgmonitor#182)

On the other hand database is open to enabling JIT for other users

Issue: [sc-15755]
Signed-off-by: Kirill Petrov <chobostar85@gmail.com>
@cbandy cbandy merged commit df492f1 into CrunchyData:master Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants