powa-team / powa-archivist

powa-archivist: the powa PostgreSQL extension
http://powa.readthedocs.io/
PostgreSQL License
53 stars 20 forks source link

powa-archivist-REL_4_1_4 make command fails on Postgres 16.3 #71

Closed hrawulwa closed 1 month ago

hrawulwa commented 2 months ago

I'm trying to compile powa-archivist 4.1.4 and create powa extension on Postgres 16x database. However the make command fails as below: [postgres@server1 powa-archivist-REL_4_1_4]$ make gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -fPIC -fvisibility=hidden -I. -I./ -I/pgbin/pgpoc1d/16.x/include/postgresql/server -I/pgbin/pgpoc1d/16.x/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o powa.o powa.c powa.c: In function ‘compute_powa_frequency’: powa.c:126:21: error: ‘instr_time’ {aka ‘struct instr_time’} has no member named ‘tv_sec’ time_powa_frequency.tv_sec = local_frequency / 1000; / Seconds / ^ powa.c:127:21: error: ‘instr_time’ {aka ‘struct instr_time’} has no member named ‘tv_usec’ time_powa_frequency.tv_usec = 0; ^ make: *** [: powa.o] Error 1

I did not face this issue on any of the 12 or 14 Postgres version database clusters.

I have a remote setup with powa-archivist 4.1.4 installed on the Repository database server. I currently monitor all 12 and 14 version DB servers. We are starting to upgrade to 16 version.

Thanks Hari

rjuju commented 2 months ago

Hi,

Yes, this is because of a breaking change in pg16, for which the compatibility was added in commit d91b272568b212cdefbcd9f493dd932b370fa558. This is only available for powa-archivist 4.2.x and above.

We don't maintain multiple powa major versions, so if you want to use pg16 or above you will have to update to 4.2 (or maybe 5.0 once we release it depending on your timing needs).

Note that updating the powa version shouldn't be that much of a problem, especially on a remote setup. This can be done entirely dynamically without any db downtime, all you need to do is to install the new packages everywhere and then run an ALTER EXTENSION powa UPDATE on all the powa databases, and then restart powa-web with the new version.

For new "branch` version (e.g. 4.x.x to 5.x.x), we usually don't provide an upgrade path as there are just too many changes, but the update can still be done dynamically without any db downtime. The difference is that you have to drop and create the powa extension everywhere. If loosing the history is a problem, you can just install the new powa version in a new database and keep the old one around (with a dedicated powa-web pointing to it) until you reached the retention period. At that point you can simply drop the old powa databases.