Skip to content
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

Set statement_timeout at session level & use reset_val as setting when source is session #17264

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

lu-zhengda
Copy link
Contributor

What does this PR do?

This PR

  • Sets statement_timeout at session level instead of connection level after database connection is established
  • Use reset_val in pg_settings query when source equals to session.
    image

Motivation

https://datadoghq.atlassian.net/browse/DBMON-3728
Prior to the change, the statement_timeout setting collected from pg_settings is set by datadog integration connection (default to 5s). This does not reflect the database level statement_timeout setting and is often misleading. In this PR, we set the statement_timeout after the connection is established. This way we can do a simple check case when source = 'session' then reset_val else setting end as setting to retrieve the server level setting.

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Changelog entries must be created for modifications to shipped code
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.

@lu-zhengda lu-zhengda added the qa/skip-qa Automatically skip this PR for the next QA label Mar 22, 2024
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 90.48%. Comparing base (9503e88) to head (bdd7f37).
Report is 3 commits behind head on master.

Additional details and impacted files
Flag Coverage Δ
activemq ?
cassandra ?
confluent_platform ?
hive ?
hivemq ?
hudi ?
ignite ?
jboss_wildfly ?
kafka ?
postgres 93.06% <87.50%> (+0.09%) ⬆️
presto ?
solr ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link

Test Results

   16 files     16 suites   20m 26s ⏱️
  282 tests   280 ✅   2 💤 0 ❌
2 264 runs  2 149 ✅ 115 💤 0 ❌

Results for commit bdd7f37.

@lu-zhengda lu-zhengda merged commit 3bd07bb into master Mar 25, 2024
46 of 47 checks passed
@lu-zhengda lu-zhengda deleted the zhengda.lu/statement-timeout branch March 25, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants