Closed banlex73 closed 3 years ago
Hello,
The pg_stat_kcache_2_2
function is new to version 2.2, and is there to avoid a crash when trying to update the extension without restarting the server first to have the new shared library loaded, which is what you just tried.
A simple restart of the postgres server should allow you to perform the update.
Hello Julien really appreciate your swift response. All good now, did as you suggested, restarted the cluster and got it updated!
postgres=# select * from pg_available_extensions where name in ('powa','pg_stat_kcache'); name | default_version | installed_version | comment ----------------+-----------------+-------------------+----------------------------------- powa | 4.1.1 | 4.1.1 | PostgreSQL Workload Analyser-core pg_stat_kcache | 2.2.0 | 2.1.3 | Kernel statistics gathering (2 rows)
postgres=# postgres=# \q [postgres@postgres-dev-uscentral1-nascheduler0-0: ~]$ pg_ctl restart -D /pgsql/cluster/data/ waiting for server to shut down..... done server stopped waiting for server to start....2020-12-14 03:04:14.545 UTC [1773] (user=) (db=) (rhost=) (app=) [vxid: txid:0] [] WARNING: unrecognized configuration parameter "powa.database" 2020-12-14 03:04:14.546 UTC [1773] (user=) (db=) (rhost=) (app=) [vxid: txid:0] [] LOG: Auto detecting pg_stat_kcache.linux_hz parameter... 2020-12-14 03:04:14.546 UTC [1773] (user=) (db=) (rhost=) (app=) [vxid: txid:0] [] LOG: pg_stat_kcache.linux_hz is set to 1000000 2020-12-14 03:04:14.557 UTC [1773] (user=) (db=) (rhost=) (app=) [vxid: txid:0] [] LOG: listening on IPv4 address "0.0.0.0", port 5432 2020-12-14 03:04:14.557 UTC [1773] (user=) (db=) (rhost=) (app=) [vxid: txid:0] [] LOG: listening on IPv6 address "::", port 5432 2020-12-14 03:04:14.560 UTC [1773] (user=) (db=) (rhost=) (app=) [vxid: txid:0] [] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2020-12-14 03:04:14.565 UTC [1773] (user=) (db=) (rhost=) (app=) [vxid: txid:0] [] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" ..2020-12-14 03:04:16.266 UTC [1773] (user=) (db=) (rhost=) (app=) [vxid: txid:0] [] LOG: could not read pg_stat_kcache file "pg_stat/pg_stat_kcache.stat": No such file or directory 2020-12-14 03:04:16.275 UTC [1773] (user=) (db=) (rhost=) (app=) [vxid: txid:0] [] LOG: redirecting log output to logging collector process 2020-12-14 03:04:16.275 UTC [1773] (user=) (db=) (rhost=) (app=) [vxid: txid:0] [] HINT: Future log output will appear in directory "/pgsql/cluster/log". done server started [postgres@postgres-dev-uscentral1-nascheduler0-0: ~]$ psql -c "alter extension pg_stat_kcache update" ALTER EXTENSION [postgres@postgres-dev-uscentral1-nascheduler0-0: ~]$ psql -c "select from pg_available_extensions where name in ('powa','pg_stat_kcache');" name | default_version | installed_version | comment ----------------+-----------------+-------------------+----------------------------------- powa | 4.1.1 | 4.1.1 | PostgreSQL Workload Analyser-core pg_stat_kcache | 2.2.0 | 2.2.0* | Kernel statistics gathering (2 rows)
нд, 13 груд. 2020 о 18:19 Julien Rouhaud notifications@github.com пише:
Hello,
The pg_stat_kcache_2_2 function is new to version 2.2, and is there to avoid a crash when trying to update the extension without restarting the server first to have the new shared library loaded, which is what you just tried.
A simple restart of the postgres server should allow you to perform the update.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/powa-team/pg_stat_kcache/issues/29#issuecomment-744124651, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIHWEYAVGHF3XKSJIVQLL6DSUVYZ3ANCNFSM4UZ2P27Q .
Good news! I'll add some documentation to specify that a postgres restart can be required (usually for a minor version change).
Hello Where: Postgres 12.5 on CentOS7 What: Getting error when running ALTER EXTENSION UPDATE either CREATE EXTENTION could not find function "pg_stat_kcache_2_2" in file "/usr/pgsql-12/lib/pg_stat_kcache.so" How I installed it: as root git clone https://github.com/powa-team/pg_stat_kcache.git cd pg_statkcache make ``` gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-12/include/server -I/usr/pgsql-12/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o pg_stat_kcache.o pg_stat_kcache.c gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -shared -o pg_stat_kcache.so pg_stat_kcache.o -L/usr/pgsql-12/lib -Wl,--as-needed -L/usr/lib64/llvm5.0/lib -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-12/lib',--enable-new-dtags /opt/rh/llvm-toolset-7/root/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2 -I. -I./ -I/usr/pgsql-12/include/server -I/usr/pgsql-12/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o pg_stat_kcache.bc pg_stat_kcache.c