Commit Graph

725 Commits

Author SHA1 Message Date
Zsolt Parragi
130d6b5fce PG-592: Treat queries with different parent queries as separate entries (#403)
* PG-592: Treat queries with different parent queries as separate entries

1. Previously pg_stat_monitor had a `topquery` and `topqueryid` field, but it was only a sample:
it showed one of the top queries executing the specific query.

With this change, the same entry executed by two different functions will result in two entries in the statistics table.

2. This also fixes a bug where the content of these field disappeared for every second query executed:
previously the update function changed topqueryid to `0` if it was non zero, and changed it to the proper id when it was 0.
This resulted in an alternating behavior, where for every second executed query the top query disappeared.

After these changes, the top query is always shown.

3. The previous implementation also leaked dsa memory used to store the parent queries. This is now also fixed.

* PG-502: Fixing review comments

* dsa_free changed to assert as it can never happen
* restructured the ifs to be cleaner
  Note: kept the two-level ifs, as that makes more sense with the assert
  Note: didn't convert nested_level checks to macro, as it is used differently at different parts of the code

* PG-502: Fixing review comments

* PG-592 Add regression test

* Make test compatible with PG12

* Remove redundant line

---------

Co-authored-by: Artem Gavrilov <artem.gavrilov@percona.com>
2024-08-06 23:43:48 +02:00
Artem Gavrilov
1aa3081eaf Drop adopters list (#480) 2024-08-01 09:12:20 -03:00
Artem Gavrilov
7680ceafd6 Drop CI workflows for PG11 (#479) 2024-08-01 09:23:26 +02:00
Muhammad Aqeel
778043a5db [PKG-144]: Fixes issue in command to get clang version. (#478) 2024-07-25 14:02:19 +05:00
Artem Gavrilov
d7999f1acf [PG-644] Add option to disable application name tracking (#469)
* Cache application name for every backed instance

* Improve pg_get_backend_status performance for PG16 and PG17

* Fix

* Make application_name tracking disabled by default

* Meke app name tracking opt-out

* Format newly added code with pgindent

* Fix build for PG17

* Fix
2024-07-23 18:49:33 +02:00
Muhammad Aqeel
16ec8362e2 [PKG-140]: Updates build scripts to build pg_stat_monitor with LLVM 1… (#476)
[PKG-140]: Updates build scripts to build pg_stat_monitor with LLVM 17.0.
2024-07-23 14:53:07 +05:00
Artem Gavrilov
dacb41f9e4 [PG-810] PG-17 Support (#463)
* Temporary disable all workflows

* Add build workflow with PG17

* Fix incompatibilities

* Fix 007_settings_pgsm_query_shared_buffer.pl test

* Fix 018_column_names.pl

* Fix 025_compare_pgss.pl

* Remove tuplestore_donestoring usage at all

* Rename I/O timing statistics columns to shared_blk_{read|write}_time

* Fix comments with fileds numbers

* Fix format

* Revert "Temporary disable all workflows"

This reverts commit 12e75beb63.

* Disable all workflows except check and build for PG 15, 16 and 17

* Fix

* Fix comments

* Fix migration

* Use REL_17_BETA1 in CI

* Add timers tests to 028_temp_block.pl

* Add local blocks timing statistics columns local_blk_{write|read}_time

* Fix t/027_local_blocks.pl test for older PG versions

* Fix

* Add jit_deform_{count|time} metrics

* Fix

* Add stats_since and minmax_stats_since fields

* Revert "Disable all workflows except check and build for PG 15, 16 and 17"

This reverts commit 73febf3aee.

* Fix t/028_temp_block.pl for PG14 and below

* Fix build for PG12

* Add pgdg workflow for PG17

* Try to fix PG pgdg workflow

* Fixes and formatting

* Format code

* Add level tracking regression test

* Fix nesting level tracking

* Format code

* Add level tracking test expected result for PG13

* Fix for PG12

* Skip level tracking regression test for PG version less than 14

* Fix toplevel calculation for older PG version

* Fix level tracking test results

* Fix nesting level counting for older PG version

* Revert "Fix nesting level counting for older PG version"

This reverts commit 3e91da8010.

* Fix level tracking for older PG versions once again

* Set REL_17_BETA2 tag for PG

* Add CI badge for PG17

* Use PG17 for examples in readme
2024-07-18 14:59:57 +02:00
Artem Gavrilov
c796995e0c Add instructions for Trunk, add PGXN badge (#473) 2024-07-12 18:23:38 +03:00
Artem Gavrilov
fdec44af94 Add CODEOWNERS file (#472)
Add codeowners file
2024-07-12 13:46:44 +02:00
Artem Gavrilov
0db7f70028 PGXN integration complete (#471)
* Fix and debug

* Temorary disable all workflows

* Try invalid version tag

* Enable upload step

* Remove pull request trigger

* Revert "Temorary disable all workflows"

This reverts commit 757e04ba58.
2024-07-12 13:46:25 +02:00
Artem Gavrilov
d83d202b9c PGXN integration (#470)
* Update PGXN META.json

* Temorary disable all workflows

* Add PGXN release workflow draft

* Add pull request trigger

* Install dependencies

* Add sudo

* More sudo

* Try older ubuntu version

* Try

* Once again

* Update PGXN workflow

* Revert "Temorary disable all workflows"

This reverts commit 8d15520a51.

* Use ubunut 22.04
2024-07-11 16:41:03 +02:00
Muhammad Aqeel
74d98475a8 Fixes clang version issue that conflicts with llvm version in percona… (#468)
Fixes clang version issue that conflicts with llvm version in percona repositories
2024-06-24 11:36:24 +05:00
Muhammad Aqeel
508e35943e Needs to install percona-release package to get GPG key. (#465) 2024-05-13 12:00:31 +05:00
Muhammad Aqeel
8d974c958f percona-release.sh is required from release-1.0-28 branch to setup AR… (#464)
percona-release.sh is required from release-1.0-28 branch to setup ARM repo.
2024-05-10 12:02:54 +05:00
Artem Gavrilov
a88c23a626 Remove redundant pgsm unistallation step from readme (#462) 2024-04-26 11:11:41 +02:00
Artem Gavrilov
288ec6325f Add license headers validation (#458)
* Add .licenserc.yaml file

* Fix license headers

* Add github action to check license headers

* Fix workflow

* Fix checkout path

* Rename workflow

* Add debug info

* Disable workflows

* Try fix

* Split check workflow in two jobs

* Try invalid license header

* Comment of failure

* Disable cppcheck job

* Fix licenserc file

* Enable debug logging

* Prevent comments from licence-eye

* Revert "Disable cppcheck job"

This reverts commit 10f55373ea.

* Revert "Disable workflows"

This reverts commit 2e2ead2fa5.

* Fix typo

* Revert "Try invalid license header"

This reverts commit 0cc0c883d2.

* Update year in license headers

* Cleanup

* Fix indention in license header
2024-04-26 10:55:50 +02:00
Muhammad Aqeel
61256faf83 [PKG-33]: Fixes PPG repo name issue for EL9. (#461) 2024-04-25 12:23:12 +05:00
Muhammad Aqeel
2b9817d3ba [PKG-33]: Fixes PPG repo name issue from Jenkins. (#460) 2024-04-24 23:18:07 +05:00
Muhammad Aqeel
0ba80547e6 [PKG-33]: Updates scripts to build pg_stat_monitor (#459) 2024-04-23 14:49:47 +05:00
Naeem Akhter
5d7c424fdc Added a tap test case to load multiple PPG extensions in the server before running a test load. (#456)
1. We load and create other extensions that are distributed by Percona
   in PPG. (postgis, pg_repack, pgaudit, pgaudit_set_user, pgpool)
2. Run test data with pgbench.

To make the above test case work, updated the workflows to install above mentioned extension
where we use installed packages from PPG. On workflows where we build server or use packages
from PGDG, we are skipping this test case.
2024-04-23 02:49:57 +05:00
Artem Gavrilov
c2923b4d61 Create SECURITY.md (#452)
* Create SECURITY.md

* Update supported versions section
2024-04-19 14:48:48 +02:00
Naeem Akhter
dce1913154 Updated README to reflect badge for pg-16 and content on the landing page. (#455) 2024-04-19 12:28:00 +02:00
Artem Gavrilov
2ebd163225 Tune CI triggers (#444)
* Use commong CI triggers for all workflows

* Tune CI triggers, fix version tag regex

* Escape regex
2024-04-18 16:52:36 +02:00
Artem Gavrilov
e3d6dc4af7 Update code-of-conduct.md (#453) 2024-04-17 15:04:50 +02:00
dependabot[bot]
0275fc742e Bump codecov/codecov-action from 2 to 4 (#451)
* Bump codecov/codecov-action from 2 to 4

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add token parameter to codecov action

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artem Gavrilov <artem.gavrilov@percona.com>
2024-04-16 15:17:59 +02:00
Artem Gavrilov
f72b8a9537 Add forum badge in readme (#447) 2024-04-16 12:34:37 +02:00
Artem Gavrilov
175e568515 [Proposal] Add issue templates (#446)
Add issue templates
2024-04-16 12:33:56 +02:00
dependabot[bot]
0bf2846748 Bump actions/upload-artifact from 2 to 4 (#450)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 12:34:50 +02:00
dependabot[bot]
e303899652 Bump actions/checkout from 2 to 4 (#449)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 12:25:02 +02:00
Artem Gavrilov
43f3c27141 Add dependabot config (#443) 2024-04-10 11:54:39 +02:00
Artem Gavrilov
e1ad88a580 Fix workflows after CI image upgrade (#445)
* Temporary disable all workflows except one

* Try ubuntu 20.04

* Remove redundant working dir config

* Fix

* Try perform some operations from default user

* Try fix

* Revert "Try fix"

This reverts commit 3ed843c7462f69d7ad74ba6f60c93544e1ea549c.

* Revert "Try perform some operations from default user"

This reverts commit 206046714d888b518bce2f83f567176978a73af9.

* Switch back to ubuntu 22.04

* Add debug

* Try fix

* Hit CI

* More debug

* Revert "Remove redundant working dir config"

This reverts commit 3d1ade8948.

* Revert "Fix"

This reverts commit 05dbeed894.

* Try fix

* Revert some changes

* Revert "Temporary disable all workflows except one"

This reverts commit 93b35036fb.

* Fix pgdg workflows

* Fix ppg workflows
2024-04-09 18:12:15 +02:00
Artem Gavrilov
7829869dc7 Fix partition_prune testcase (#440)
* Disable workflows

* Disable pg_stat_monitor tests

* Add no-locale to initdb

* Try with enabled compute_query_id

* Enable tests

* Cleanup

* Set compute_query_id parameter to regress mode

* Revert "Disable workflows"

This reverts commit f0b85b8b4a.

* Fix pg 14 and 15 build workflows

* Fix

* Cleanup
2024-04-09 14:05:58 +02:00
Artem Gavrilov
684e6483b5 Fix cppcheck workflow (#441)
* Upgrade ubuntu from 20.04 to 22.04

* Temporary remove all workflows except cppcheck

* Try ununty 23.10

* Revert "Try ununty 23.10"

This reverts commit c8590b60ed.

* Try cppcheck built from sources

* Add sudo

* Bump checkout action version in cppcheck workflow

* Revert "Temporary remove all workflows except cppcheck"

This reverts commit 9f32e94992.
2024-04-05 19:42:40 +02:00
Artem Gavrilov
c89879e372 Fix IPC::Run perl module name in CI (#438) 2024-04-05 19:42:00 +02:00
Artem Gavrilov
64c71f98de Fix integer overflow (#435)
* Fix MAX_BUCKETS_MEM overflow

* Fix MAX_QUERY_BUF overflow

* Fix int overflow in IsBucketValid function

* Add missing newline

* Remove test for max value of pgsm_query_shared_buffer parameter

* Tune tests

* Cleanup

* Use int64 type instead of long long
2024-04-05 14:34:30 +02:00
Muhammad Aqeel
7ea569e6bc Merge pull request #437 from maqeel75/main
Rename .ddeb extension to .deb
2024-03-05 18:03:16 +05:00
Muhammad Aqeel
3d846105c5 Rename .ddeb extension to .deb 2024-03-05 16:22:19 +05:00
Muhammad Aqeel
7ecd10a7de Merge pull request #436 from maqeel75/main
[DISTPG-724]: Updated version of pg_stat_monitor and fixed build scri…
2024-02-07 14:47:47 +05:00
Muhammad Aqeel
5bb67963e7 [DISTPG-724]: Updated version of pg_stat_monitor and fixed build script issues. 2024-02-05 13:34:41 +05:00
Hamid Akhtar
75f86f54b1 Version bumped for the 2.0.4 release (#434)
Version bumped for the 2.0.4 release.
2.0.4
2023-12-12 17:26:55 +01:00
Hamid Akhtar
4863020ccd PG-646: pg_stat_monitor hangs in pgsm_store
A potential lock contention could've been caused when an OOM warning
was being emitted by the pgsm_store function. This could lead the
pg_store_error function calling pgsm_store function and thereby trying
to acquire and exclusive lock when a shared was already by the same
process. This warning is now guarded by protection block.
2023-11-24 15:29:45 +05:00
Hamid Akhtar
0a8ac38de9 Version bumped for the 2.0.3 release. (#430) 2.0.3 2023-11-14 17:30:46 +05:00
Hamid Akhtar
a35689bd36 Merge pull request #427 from Naeem-Akhter/pg16
Added workflow file for pgsm ppg-16 package testing.
2023-11-08 14:11:46 +05:00
Naeem Akhter
3ed25d5511 Added workflow file for pgsm ppg-16 package testing. 2023-11-07 00:01:07 +05:00
Hamid Akhtar
ddc5a1745b Merge pull request #425 from codeforall/main
PG-645: pg_stat_monitor crashes PostgreSQL if there is citus ..
2023-11-01 13:36:26 +05:00
Muhammad Usama
823bfb9aa7 PG-645: pg_stat_monitor crashes PostgreSQL if there is citus ..
Do not look for the query in the hash if no query string is
provided in the planner hook.
2023-11-01 10:54:35 +05:00
Hamid Akhtar
67493acda4 Merge pull request #422 from Naeem-Akhter/pg16
Adding pg-16 build and PGDG workflows.
2023-10-23 16:40:49 +05:00
Naeem Akhter
715a4ceb82 Adding pg-16 build and PGDG workflows. 2023-09-12 14:37:19 +05:00
Hamid Akhtar
3b9d125ba0 Version bumped for the 2.0.2 release. 2.0.2 2023-09-12 12:46:13 +05:00
Hamid Akhtar
9cf2fb8d56 PostgreSQL 16 support for PGSM
* Fixing issues with GUC initialization and function renames
    * Fixed regression issues with PG16
2023-09-12 12:45:58 +05:00