feat: exclude backups from long running queries#3790
Conversation
| expect(query).to.contain("interval '5 minutes'") | ||
| }) | ||
|
|
||
| it('excludes the internal physical backup query from results', function () { |
There was a problem hiding this comment.
Nit: This test doesn't really check that the conditions are applied as we expect to exclude the backup processes, only that those substrings are part of the query somewhere. When I gave this a try I got something like https://github.com/heroku/heroku-pg-extras/pull/285/changes#diff-936516becf10c8c9b53b618de31d7bdf2fc7d0555dc96a3176441c6956ed4a2dR100-R105, although it isn't the prettiest.
There was a problem hiding this comment.
Yeah I think the proper way to test this may be to parse into a sql ast, anything else is just janky string matching imo. For now, just matched existing testing patterns
subakva
left a comment
There was a problem hiding this comment.
Looks good to me. I hope this reduces some confusion about expected background processes.
Summary
This pr adds a
whereclause topg:long-running-queriesto filter out backups that are expected, low impact, and not actionable for customers. This command is meant to provide clarity for debugging, so the existence of this query leads to customer confusion. Thepg:pscommand will continue to show all active queries.Type of Change
Breaking Changes (major semver update)
!after your change type to denote a change that breaks current behaviorFeature Additions (minor semver update)
Patch Updates (patch semver update)
Testing
Notes:
Standard db Testing
ps shows all running queries. Below we see follower replication, backup, and user queries:
long-running-queries pre-implementation, we see the backup and follower queries:
Post-implementation we only see the user query, filtering out the backup and follower queries:
Post-implementation smoke tests for essential and advanced show the command runs without error:
Screenshots (if applicable)
Related Issues
GUS work item: W-22101694