Commit Graph

432 Commits (f09643f592fcf1b0b7e74f0944018a0bf13d45b8)

Author SHA1 Message Date
Evgeniy Patlan f09643f592 PG-7 add ubuntu22 support 2022-04-29 13:33:07 +03:00
Ibrar Ahmed 34fe8ec4b1
Merge pull request #206 from nastena1606/PG-358-Doc-data-display-by-PGSS-PGSM-RC2
PG-358 Documented block and WAL data display
2022-04-21 23:18:17 +05:00
Ibrar Ahmed 2721148f71
Merge pull request #207 from ibrarahmad/REL1_0_STABLE
PG-380: Bump version to 1.0.0.
2022-04-21 23:17:10 +05:00
Ibrar Ahmed b99e1018af PG-380: Bump version to 1.0.0. 2022-04-20 07:44:11 +00:00
Lenz Grimmer 9fd4cdaae0
Merge pull request #205 from nastena1606/PG-368-Doc-1.0.0-version
Pg 368 doc 1.0.0 version
2022-04-14 08:10:14 +00:00
Lenz Grimmer 593ed88faa
Merge pull request #203 from nastena1606/PG-371-Doc-Release-notes-RC2-update 2022-04-14 08:09:45 +00:00
Anastasia Alexadrova acc411146d PG-368 Amended GH action for 1.0.x version 2022-04-14 09:02:03 +03:00
Anastasia Alexadrova e8586bd096 Added requirements.txt for doc build 2022-04-13 11:47:36 +03:00
Anastasia Alexadrova f6058c9629 Added requirements.txt for doc build 2022-04-13 11:46:59 +03:00
Anastasia Alexadrova 181840cc19 PG-371 Updated RC release notes with new issues
modified:   docs/RELEASE_NOTES.md
2022-04-13 11:38:06 +03:00
Ibrar Ahmed afd2e1dac7
Merge pull request #201 from darkfronza/PG-369_fix_wal_bytes
PG-369: Fix wal_bytes values on PG <= 12.
2022-04-12 17:05:43 +05:00
Ibrar Ahmed 75acfbb8d5
Merge pull request #199 from nastena1606/PG-344-Doc-extension-order-for-PG14-RC2
PG-344 Described the extensions behavior for collecting data depending on order
2022-04-12 16:40:40 +05:00
Ibrar Ahmed 9b05dac3e6
Merge pull request #198 from nastena1606/PG-359-Doc-pgsm_track-RC2
PG-359 Doc - Update pg_stat_monitor_settings view with new options (RC2)
2022-04-12 16:40:05 +05:00
Ibrar Ahmed 7e829cb254
Merge pull request #197 from nastena1606/PG-353-Release-notes-RC2
PG-353 Release notes RC2
2022-04-12 16:39:48 +05:00
Diego Fronza 409f384ce8 PG-369: Fix wal_bytes values on PG <= 12.
Similar to pg_stat_statements, pg_stat_monitor tracks wal data metrics
since PostgreSQL 13, the problem was that for PostgreSQL versions 11 and
12 we left the WalUsage variable declared in the stack unitialized,
thus leading to garbage values.

Fixed the problem by ignoring the WalUsage variable value for PG <= 12.
2022-04-11 14:20:43 -03:00
Ibrar Ahmed 1ed35c648a
Merge pull request #200 from nastena1606/PG-364-Align-doc-structure-with-main
PG-364 Aligned docs structure with main
2022-04-08 11:11:12 -07:00
Anastasia Alexadrova c5dd547619 PG-364 Aligned docs structure with main
Changed the GH action to buid a separate doc version, 1.0.x stable, from REL1_0_0 branch
2022-04-06 15:05:20 +03:00
Anastasia Alexadrova 09010f069f PG-353 Relelase notes RC2
modified:   docs/RELEASE_NOTES.md
2022-04-01 17:48:46 +03:00
Anastasia Alexadrova 5e2dac0608 PG-359 Doc - Update pg_stat_monitor_settings view with new options
modified:   docs/USER_GUIDE.md
2022-03-31 09:30:39 +03:00
Anastasia Alexadrova 65aaca6313 PG-344 Described the extensions behavior for collecting data depending on order
modified:   README.md
2022-03-30 21:45:15 +03:00
Anastasia Alexadrova 0b9479aa19 PG-358 Documented block and WAL data display
Due to different data processing by both extensions, these stats appear as inconsistent.

modified:   README.md
	modified:   docs/COMPARISON.md
2022-03-30 18:41:39 +03:00
Ibrar Ahmed 713f6f13f4
Merge pull request #193 from Naeem-Akhter/REL1_0_STABLE_Latest
PG-361: Change sequence of regressions.; PG-343: Enable TAP testing.; PG-292: Automate the QA.; PG-338: Calls count.; PG-331: Default values in PMM.
2022-03-22 22:56:55 +05:00
Naeem Akhter 4bdb11aadc Change the sequence regressions, moved installcheck-world to last to make sure that we already have ran the pg_stat_monitor regression and server regression don't imapct it. 2022-03-22 18:42:43 +05:00
Naeem Akhter 3979a205c5 Fixed expected output file for histogram testcase. 2022-03-22 01:55:58 +05:00
Naeem Akhter 96eed05890 PG-343: Enable TAP testing; PG-292: Automate the QA; PG-338: Calls count.; PG-331: Default values in PMM.
This commit brings following changes to this branch:
1) Port changes/additions TAP testing from main branch to this branch, under PG-292.
2) Changes to test cases due to GUCs change, under PG-331.
3) Call counts verfications, under PG-338.
4) Changes to github workflows to accomodate automation for TAP testing, under PG-343.
2022-03-22 01:36:47 +05:00
Ibrar Ahmed 34e14104d7
PG-338: Calls count is not correct in PG-13.; PG-331: Default values for better presentation in PMM (#191)
* PG-338: Calls count is not correct in PG-13.
* PG-331: Defaults values for better presentation in PMM.
* Update pg_stat_monitor.c

Co-authored-by: Lenz Grimmer <lenz.grimmer@percona.com>
Co-authored-by: Hamid Akhtar <hamid.akhtar@gmail.com>
Co-authored-by: Ibrar Ahmad <ibrar.ahmad@gmail.com>
2022-03-21 17:53:59 +05:00
Hamid Akhtar 9abef85ede
Merge pull request #190 from ibrarahmad/REL1_0_STABLE
PG-338: Calls count is not correct in PG-13.
2022-03-15 18:20:17 +05:00
Ibrar Ahmed 153f8d2e87 PG-338: Calls count is not correct in PG-13.
cherry-pick patch (b6838049b6) by Diego
and I did some refatoring.
2022-03-14 18:14:11 +00:00
Hamid Akhtar 961ddd9e11 PG-356: Bump version to 1.0.0-rc.2. 2022-03-09 19:30:09 +05:00
Hamid Akhtar 23f2ef13b8
Merge pull request #189 from ibrarahmad/REL1_0_STABLE
PG-355: Collect accumulative value of sys_time and user_time.
2022-03-09 18:55:18 +05:00
Ibrar Ahmed 7debd7a962 PG-355: Collect accumulative value of sys_time and user_time.
Collect accumulative value of sys_time and user_time, because
separate value for each same query will override the previous value.
2022-03-03 17:25:07 +00:00
Ibrar Ahmed 34a4676015
Merge pull request #188 from EngineeredVirus/REL1_0_STABLE
Cherry picking missing features/commits and resolving compilation issues
2022-03-02 16:33:00 +05:00
Hamid Akhtar c52208e0c9 Updating expected output for histogram to accomodate bigger bar column 2022-03-02 16:05:51 +05:00
Diego Fronza bba6494eff Updating expected output for counters. 2022-03-02 16:04:30 +05:00
Diego Fronza 5db7056840 Resolving compilation failures after cherry-picking of require commits
from the main branch.
2022-03-01 19:25:29 +05:00
Diego Fronza d839cc4255 PG-350: Fix bucket time overflow.
To check if a bucket has expired, a comparison of the time elapsed
since last bucket change was being done in get_next_wbucket() function
using the following line:

while ((current_usec - current_bucket_usec) > (PGSM_BUCKET_TIME
* 1000 * 1000))

The problem is that the expression compares a uint64 (current_usec)
with a int32 (PGSM_BUCKET_TIME), if a given user configures a value for
pgsm_bucket_time GUC (let's call it T) that could overflow int32 range
in the expression T*1000*1000 > 2**31-1, then the result would be a
negative integer cast to (uint64), resulting in a large uint64 value that
would evaluate the expression as false, thus never updating bucket
number.

When querying pg_stat_monitor view, for every entry it's verified if
the entry has not yet expired by calling IsBucketValid(bucket_number).
Using the entry's bucket number the function calculates if the time
since the bucket started, using shared global variable
pgss->bucket_start_time[bucket_id], is still valid.

Since pgss->bucket_start_time is not properly initialized in
get_next_wbucket(), the function IsBucketValid() will always
return false, thus not listing any entries in the view.
2022-03-01 19:23:25 +05:00
Diego Fronza 5528bef82d PG-326: Validate histogram_min and histogram_max ranges.
Added hook for checking histogram min and max values, in order to ensure
that histogram_min is always less than histogram_max.
2022-03-01 13:13:41 +05:00
Diego Fronza a716273f19 PG-338: Fix counters regression test.
After fixing the problem with utility statements, this whole block:
do $$
declare
   n integer:= 1;
begin
	loop
		PERFORM a,b,c,d FROM t1, t2, t3, t4
			 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a;
		exit when n = 1000;
		n := n + 1;
	end loop;
end $$;

Is only processed once, as those are nested statements, in order to
match the 1000 statements the GUC pg_stat_monitor.track must be set to
'all' and then back to the default of 'top' when done testing it.
2022-03-01 13:13:34 +05:00
Diego Fronza 79e0a86e4b PG-338: Fix query call count (utilities).
There was a missing increment/decrement to exec_nested_level in
pgss_ProcessUtility hook, due to this, some utility statements could
end up being processed more than once, as PostgreSQL may recurse into
this hook for sub-statements or when processing a query string
containing multiple semicolon-separated statements.
2022-03-01 13:13:28 +05:00
Ibrar Ahmed cb5aab89b3
Merge pull request #184 from EngineeredVirus/REL1_0_STABLE
Cherry picking changes from the master branch for REL1_0_STABLE branch
2022-02-21 18:44:42 +05:00
Anastasia Alexadrova 781282364c PG-287 Added uninstall steps to README
modified:   README.md
2022-02-17 19:50:28 +05:00
Lenz Grimmer 482744e77b docs: Updated Forum URL, removed Discord link
Updated the Forum URL to point to the dedicated
pg_stat_monitor forum in `README.md` and
`CONTRIBUTING.md`, removed link to the Discord
channel to ensure that conversations are focused
to one location. Updated the table of contents in
the README.

Signed-off-by: Lenz Grimmer <lenz.grimmer@percona.com>
2022-02-17 19:50:28 +05:00
Naeem Akhter 5aa6764041 PG-267 Add testcase to test histogram.
This commit adds following three sql based testcases:

1) Test unique application name set by user.
2) Histogram function is working properly as desired.
3) Error on insert is shown with proper message.
2022-02-17 19:50:25 +05:00
Diego Fronza 0573be4090 PG-329: Fix creation of pg_stat_monitor_errors view on SQL files.
After the split into multiple pg_stat_monitor--1.0.XX.sql.in sql files,
where XX is the PostgreSQL version, it was forgotten to add the errors
view to the relevant files, this commit fixes that.
2022-02-17 19:49:51 +05:00
Anastasia Alexadrova 11def58e7e PG-308 README Updates
Added a link to pg_stat_monitor view reference in the Overview
Aded PG 14 to supported versions
Updated links in the Documentation section

modified:   README.md
2022-02-17 19:49:51 +05:00
Anastasia Alexadrova 8d4cbefdf5 PG-298 Add 'Report a bug' section to readme
modified:   README.md
2022-02-17 19:49:51 +05:00
Diego Fronza 9f8f94ed9c PG-325: Fix deadlock.
If a query exceeds pg_stat_monitor.pgsm_query_max_len, then it's
truncated before we save it into the query buffer (SaveQueryText).

When reading the query back, on pg_stat_monitor_internal, we allocate a
buffer for the query with length = pg_stat_monitor.pgsm_query_max_len,
the problem is that the read_query function adds a '\0' to the end of
the buffer when reading a query, thus if a query has been truncated, for
example, to 1024, when reading it back read_query will store the '\0' at
the position 1025, an out of array bounds position.

Then, when we call pfree to release the buffer, PostgreSQL notices the
buffer overrun and triggers an error assertion, the assertion calls our
error hook which attempts to acquire the shared pgss->lock before
pg_stat_monitor_internal has released it, leading to a deadlock.

To avoid the problem we add 1 more byte to the extra '\0' during palloc
call for query_text and parent_query_text.

Also, we release the lock before calling pfree, just in case PostgreSQL
finds a problem in pfree we won't deadlock again and get the error
reported correctly.
2022-02-17 19:49:51 +05:00
Diego Fronza 24ae3fa66f PG-296: Fix application name.
If a backend would change the application name during execution,
pg_stat_monitor would then fail to read the updated value, as it caches
the result in order to avoid calling the expensive functions
pgstat_fetch_stat_numbackends() and pgstat_fetch_stat_local_beentry().

A workaround was found, we can just read an exported GUC from
PostgreSQL backend itself, namely application_name, from utils/guc.h,
thus saving us from having to call those expensive functions.
2022-02-17 19:49:45 +05:00
Vadim Yalovets 1d41f62294 DISTPG-353 PG Debian Requirement: the Description is overflowing 2022-02-17 19:49:17 +05:00
Diego Fronza e079e65da0 PG-299: Fix conflicts between devel and master.
Updated sql files (pg_stat_monitor_settings view).

Using right variable name and level checking on pgss_store:
key.toplevel = ((exec_nested_level + plan_nested_level) == 0);
2022-02-17 19:49:17 +05:00