Commit Graph

5 Commits (5356e2e75cbe2fea588216c6a23b9fe008cf6cd5)

Author SHA1 Message Date
Naeem Akhter 8647a52856 PG-292: Automate the Q/A and implement tap testcases.
This commit brings following changes:
1) Implementation of tap based testing using perl language for different
scenarios that could not be covered under traditional SQL based diff testing,
or require server start/shutdown. At this point of time, tap testing is only
enabled for Postgres 14 & 13, for rest of back branches it will be done at
laster time as there is substantial change in number of columns and their
names.
2) Changes to github action workflows for Postgres 14 & 13 to accomodate the
requirements for tap testing.
3) Similarly, minor changes to Makefile are also done.
4) Testing of supported GUCs using tap tests for different possible
configuration.
5) pg_stat_monitor_reset_errors testing using the tap testcases.
6) Insufficient shared space and buffer overflow testing via tap testcases.
7) Some sql scripts under 'scripts' folder to generate some work load requried
for tap test cases.
8) Everything under 't' folder is specific to perl based test cases. It houses
perl files and folders for some expected files and result folder.
9) 90%+ code coverage for LOC and functions.
10) PG-339 Fix by diego, change in pgsm_errors.c.
2022-01-27 23:49:38 +05:00
Diego Fronza 6f7f44b744 PG-286: Fix deadlock.
Can't call elog() function from inside the pgsm_log as the pgss_hash
lock could be already acquired in exclusive mode, since elog() triggers
the psmg_emit_log hook, when it calls pgss_store it will try to acquire
the pgss_hash lock again, leading to a deadlock.
2021-12-30 09:48:27 -03:00
Diego Fronza 8ea02b0f2a PG-228: Fix hash table creation flags on PG <= 13.
Before PostgreSQL 14, HASH_STRINGS flag was not available when creating
a hash table with ShmemInitHash().

Use HASH_BLOBS for previous PostgreSQL versions.
2021-12-30 09:46:15 -03:00
Diego Fronza 6f353a5596 PG-228: Add severity to the internal message logging API.
Add support to include the severity of messages added to the
pg_stat_monitor_errors view.
2021-12-30 09:46:15 -03:00
Diego Fronza c37713b9d5 PG-228: Add new view, pg_stat_monitor_errors.
The pg_stat_monitor_errors view was created in order to help inspecting
internal errors that may occur in pg_stat_monitor module itself, it
contains the error message, its severity, the last time the error occurred
and the number of times that any given error ocurred.

Implementation details:
 - A new lwlock was added to the pgssSharedState structure in order to
   control access to the errors hash table.
 - Increased RequestNamedLWLockTranche() no. of locks requested to 2.
 - The function GetNamedLWLockTranche() returns an array of locks, we
   use the first lock for controlling access to the usual buckets hash
   table, and the second one to control access to the errors hash table.
 - During module initialization (_PG_init) we increased the amount of
   shared memory space requested to include space to the new errors hash
   table: RequestAddinShmemSpace(... + pgsm_errors_size())
 - The implementation in pgsm_errors.c simple uses a hash table to track
   error messages, the message is also used as the key.
2021-12-30 09:46:12 -03:00