Repository navigation
feat(pg_stat_monitor): upgrade from 2.1.0 to 2.4.0 - #2673
Open
Naeem-Akhter wants to merge 1 commit into
Open
Naeem-Akhter wants to merge 1 commit into
Naeem-Akhter wants to merge 1 commit into
Conversation
…enssl/krb5 inputs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Additional context
Changes
nix/ext/versions.json: add pg_stat_monitor 2.4 (tag2.4.0) for PG 15 and 17.nix/ext/pg_stat_monitor.nix:pg_stat_monitor--${version}.sql.in. The 2.1.0 tag doesn't ship that file (it has--2.0.sqlplus upgrade scripts), so adding any version newer than 2.1 broke the build. The move is now conditional (still used for the 1.0.x tag). Older versions contribute only their library and control file, and the latest version provides all SQL scripts. The upgrade scripts shared by 2.1.0 and 2.4.0 differ only in formatting, with no change to objects or function attributes.libpq/libpq-be.h, which pulls inopenssl/ssl.handgssapi/gssapi.hfor this Postgres build, soopensslandkrb5are added tobuildInputs.nix/tests/expected/z_{15,17,orioledb-17}_ext_interface.out: updated for the 2.4 interface:pg_stat_monitor_internalgains OUT columnswal_buffers_full,parallel_workers_to_launch,parallel_workers_launched,generic_plan_calls,custom_plan_callspgsm_create_11_view,pgsm_create_13_view,pgsm_create_view; added:pgsm_create_18_view,pgsm_create_19_view?w=1): the real change is about 10 lines per file.ansible/vars.ymlhas no pg_stat_monitor entry and no migrations reference it, so neither needs a change.User-facing note: per the 2.4.0 release notes, some
pg_stat_monitorview columns report different values than 2.1 (e.g.plansnow counts only actual planner invocations), so metrics may shift across the upgrade.Testing (aarch64-darwin)
nix flake check -L: all checks pass. One unrelated local-only flake:hstore_copy_binaryfailed once on macOS because a leftover/tmp/pg_regress_hstore_dup.binwas owned by another_nixblduser (no sandbox on darwin, so/tmpis shared). It passes after removing the file. Not applicable to Linux CI.treefmtandpre-commitpass.Not covered
z_multigres-17_ext_interface.outandz_multigres-orioledb-17_ext_interface.outare not regenerated, because there is no aarch64-darwin check for these variants. I expect the same pg_stat_monitor-only changes and can update them from CI output.supa db-statsverification require Supabase infrastructure (see Action Items).Observation (not changed in this PR). Running
CREATE EXTENSION pg_stat_monitor VERSION '2.1'without first runningswitch_pg_stat_monitor_version 2.1binds the functions to mixed libraries. The 2.0 install step uses the main control file, which points to the latest library, and the view then fails with "Must be loaded via shared_preload_libraries". The intended flow (switch first) avoids this. Happy to follow up with per-version install scripts generated from each tag if useful.Action Items
pg_stat_monitor.pgsm_overflow_target(no-op since 2.0.0);pgsm_track_application_namesnow has no effect; several view columns report changed values (e.g.planscounts only actual planner invocations)ansible/,nix/,migrations/), so no config change is neededext_interfacesnapshots (new OUT columns onpg_stat_monitor_internal, PG 18/19 view helpers)CREATE→DROP→CREATE EXTENSION pg_stat_monitor: no errors in the server logpg_stat_monitor_version()= 2.4.0; query tracked in thepg_stat_monitorview;pg_stat_monitor_reset()OKCREATE EXTENSION ... VERSION '2.1'→ALTER EXTENSION ... UPDATE→ 2.4; view queryable afterwardspg_dump -Fc→pg_restoreinto a new database with pg_stat_monitor enabled: extension 2.4 restored, data intact, view queryable, no log errorssupa db-statssteps require Supabase infrastructure. I'd appreciate a maintainer running those.