Commit Graph

447 Commits

Author SHA1 Message Date
Diego Fronza
47e84f96c3 PG-234: Fix loading both pg_stat_monitor and pg_stat_statements.
If both modules are loaded then pg_stat_monitor detects that and avoid
calling standard_ProcessUtility() in ProcessUtility_hook hook, as
calling it twice is an error and triggers an assertion on PostgreSQL.

On PostgreSQL 13, pg_stat_monitor must be loaded after
pg_stat_statements, as pg_stat_statements doesn't do such verifications,
it end calling standard_ProcessUtility() and other functions even if
another module is registered, that is an error.

They fixed this problem with pg_stat_statements in PostgreSQL 14 and onward.
2021-11-22 15:13:30 -03:00
Ibrar Ahmed
96fde5931c Merge pull request #140 from nastena1606/PG-210-Doc-Update-column-names-for-PG14-master
PG-210 Doc: Updated column names depending on PG version
2021-11-17 16:58:00 +05:00
Anastasia Alexadrova
bb7fd54b74 PG-210 Doc: Updated column names depending on PG version
added a footenote about toplevel being available starting from PG14 only

modified:   docs/COMPARISON.md
	modified:   docs/REFERENCE.md
2021-11-17 13:27:56 +02:00
Ibrar Ahmed
ac2aaec72f Merge pull request #139 from EvgeniyPatlan/master
DISTPG-307: update pg_stat_stat_monitor
2021-11-17 11:28:23 +05:00
Evgeniy Patlan
892a117487 DISTPG-307 update pg_stat_stat_monitor 2021-11-17 07:52:52 +02:00
Ibrar Ahmed
6cf798416e Update README.md 2021-11-17 01:42:55 +05:00
Ibrar Ahmed
973cb16d34 Update README.md 2021-11-17 01:42:10 +05:00
Ibrar Ahmed
0248c1fe5e Rename workflows. 2021-11-16 20:41:04 +00:00
Ibrar Ahmed
ff7d82be6e Update README.md 2021-11-17 01:38:24 +05:00
Ibrar Ahmed
a0c848749c Update README.md 2021-11-17 01:36:38 +05:00
Ibrar Ahmed
88523792f5 Rename workflows. 2021-11-16 20:30:34 +00:00
Ibrar Ahmed
5e2b107471 Update README.md 2021-11-17 01:20:08 +05:00
Ibrar Ahmed
b5cbd98ae8 Update and rename pg11test.yml to postgresql-11-build.yml 2021-11-17 01:19:32 +05:00
Ibrar Ahmed
5d06977110 Merge pull request #138 from darkfronza/PG-277_fix_regression_pgsm_overflow_target_defaults
PG-277: Fix regression tests (pgsm_overflow_target defaults).
2021-11-17 01:13:42 +05:00
Diego Fronza
c577750538 PG-277: Fix regression tests (pgsm_overflow_target defaults).
Adjust guc_1.out to match guc.out defaults for pgsm_overflow_target.
2021-11-16 16:31:44 -03:00
Ibrar Ahmed
d3725790d4 Regression Fix. 2021-11-16 12:01:46 +00:00
Ibrar Ahmed
74dd7c80d8 Regression Fix. 2021-11-16 11:46:15 +00:00
Ibrar Ahmed
c8d7209149 PG-273: pg_stat_monitor_hook_stats disable to end user. 2021-11-16 11:38:21 +00:00
Ibrar Ahmed
680c7fda42 PG-210: Add new column toplevel. 2021-11-16 11:23:59 +00:00
Ibrar Ahmed
5f6177daa3 PG-210: Add new column toplevel. 2021-11-16 10:48:11 +00:00
Ibrar Ahmed
6ea5a8991c Merge pull request #135 from percona/devel
Devel
2021-11-14 20:15:30 +05:00
Ibrar Ahmed
351f4e4644 Merge pull request #134 from darkfronza/PG-276_fix_regression_tests
PG-276: Fix regression tests.
2021-11-14 20:15:10 +05:00
Diego Fronza
0a45fc740f PG-276: Fix regression tests.
The guc_1.out is used for PG >= 13, where query track planning is
available, so it has been restored.
2021-11-12 16:55:51 -03:00
Ibrar Ahmed
192ec4e470 Merge pull request #133 from percona/devel
Devel
2021-11-13 00:37:52 +05:00
Ibrar Ahmed
85b7cabf50 Merge pull request #132 from darkfronza/PG-275_fix_regression_tests
PG-275: Fix regression tests.
2021-11-13 00:37:29 +05:00
Diego Fronza
3be31d67e9 PG-275: Fix regression tests.
Removal of redundant file guc_1.out.

Adjusted guc.out to match query planning disabled by default.
2021-11-12 14:42:17 -03:00
Ibrar Ahmed
f1166c306a Merge pull request #130 from darkfronza/PG-272_fix_server_crash
PG-272: Fix server crash when calling pg_stat_monitor_reset().
2021-11-12 20:42:29 +05:00
Ibrar Ahmed
0148409b33 Merge pull request #131 from percona/devel
Devel
2021-11-12 20:41:37 +05:00
Ibrar Ahmed
22fab87dec Merge pull request #129 from darkfronza/PG-220_fix_pgsm_overflow_target
PG-220: fix pgsm overflow target
2021-11-12 20:40:33 +05:00
Diego Fronza
997639c067 PG-272: Fix server crash when calling pg_stat_monitor_reset().
The loop that resets the query buffers was incorrecly using MAX_BUCKETS
to indicate the number of buckets to clear, which defaults to 10. If a
user lowers this value the loop would access a pointer beyond the number
of query buffers allocated.

Fix the problem by using the correct PGSM_MAX_BUCKETS GUC as the limit
to the loop.
2021-11-12 10:58:56 -03:00
Ibrar Ahmed
3f937e30de Merge pull request #128 from nastena1606/PG-215-Doc-Fix-links-master
PG-215: Doc Fixed links to usage examples,
2021-11-12 16:30:17 +05:00
Anastasia Alexadrova
18f357284a PG-215 Doc Fixed links to usage examples,
reaorded usage examples to align with feature order
modified:   docs/USER_GUIDE.md
2021-11-12 12:57:08 +02:00
Ibrar Ahmed
06b5e4c5fe PG-210: Columns names should match upstream pg_stat_statements column names. 2021-11-10 19:30:32 +00:00
Ibrar Ahmed
20f3d8c047 PG-210: Columns names should match upstream pg_stat_statements column names. 2021-11-10 18:33:02 +00:00
Ibrar Ahmed
51a6d38c45 Merge pull request #125 from denisok/add_build_dep
add dependencies for build
2021-11-10 22:31:07 +05:00
Ibrar Ahmed
c4780aba5a Merge pull request #124 from nastena1606/PG-215-Doc-User-guide-updates-master
PG-215 User Guide updates
2021-11-10 22:27:55 +05:00
Anastasia Alexandrova
89ddcb5391 Merge branch 'master' into PG-215-Doc-User-guide-updates-master 2021-11-10 19:26:22 +02:00
Ibrar Ahmed
28efbc90c7 Merge pull request #127 from rnovikovP/patch-3
PG-256: DOC about Views presentation
2021-11-10 22:06:44 +05:00
Roma Novikov
09f298b8d6 PG-256: DOC about Views presentation 2021-11-10 15:47:29 +02:00
Anastasia Alexandrova
f186a28a2d Merge branch 'master' into PG-215-Doc-User-guide-updates-master 2021-11-05 14:46:39 +02:00
Anastasia Alexadrova
d9c281a408 Fixed cmd_type* columns in the Reference doc 2021-11-05 14:42:26 +02:00
EvgeniyPatlan
22ebe35cb1 Merge pull request #126 from EvgeniyPatlan/master
PG-264 fix version
1.0.0-Beta-2
2021-11-01 16:01:21 +02:00
Evgeniy Patlan
ac7aa57995 PG-264 fix version 2021-11-01 14:49:35 +02:00
Denys Kondratenko
5b5979c0aa add dependencies for build 2021-10-29 23:20:54 +02:00
Diego Fronza
f66b45afd6 PG-220: Fix read/write of dumped query buffer to files.
This commit fix some issues when the query buffer overflows and
pg_stat_monitor attempts to dump its contents to a file.

The dump process is now as follows:

1. The dump will always be a full dump of the current query buffer,
   meaning pg_stat_monitor will dump MAX_QUERY_BUFFER_BUCKET bytes to
   the dump file.
2. When scanning the dump file, read chunks of size
   MAX_QUERY_BUFFER_BUCKET, then look for the query ID using that chunk
   and the query position metadata, this allows pg_stat_monitor to avoid
   scanning the whole chunk when looking for a query ID.

The code in charge to read from/write to the dump file now takes into
account that read() and write() may return less bytes than what it was
asked for, the code now ensures that we actually read or write the
amount of bytes required (MAX_QUERY_BUFFER_BUCKET), also it handles
rare but posssible interrupts when doing those operations.
2021-10-25 16:55:30 -03:00
Anastasia Alexadrova
d5e25f961f PG-215 User Guide updates
Moved pg_stat_monitor column description and compaison to separate docs

new file: REFERENCE.md
new file: COMPARISON.md
2021-10-25 10:03:37 +03:00
Diego Fronza
e593dbccc3 PG-220: Fix GUC regression test (pgsm_overflow_target).
Updated expected output for pgsm_overflow_target to match the default
value of 1.
2021-10-22 15:40:27 -03:00
Diego Fronza
c3d167e452 PG-220: Check possible query buffer overflow.
In SaveQueryText() we check for a possible overflow in the query buffer,
but if overflow would happen and pgsm_overflow_target value is 1 (the
default), then we dump the query buffer to a temporary file and reset
the buffer (start saving queries from the start of the buffer). The
problem is that after resetting the buffer we don't check if the current
query length would exceed the buffer size of MAX_QUERY_BUFFER_BUCKET, if
that is the case the buffer would overflow and probably crash the
process or in the worst case become an attack vector for exploitation.

This commit fix the problem by adding an additional check for overflow
after resetting the query buffer.
2021-10-22 15:40:27 -03:00
Diego Fronza
fa55eb333d PG-220: Fix pgsm_overflow_target defaults.
The GUC variable pgsm_overflow_target was pointing to the wrong index
(12, pgsm_track_planning) in the "GucVariable conf[MAX_SETTINGS]" array.

Adjusted it to the right index, 11.
2021-10-22 15:40:27 -03:00
Ibrar Ahmed
693838c979 PG-263: Bump version to 1.0.0 - Beta2. 2021-10-22 16:27:36 +00:00