percona / pg_stat_monitor

Query Performance Monitoring Tool for PostgreSQL
https://docs.percona.com/pg-stat-monitor/
Other
460 stars 58 forks source link

PostgreSQL 17 support #474

Open devrimgunduz opened 1 month ago

devrimgunduz commented 1 month ago

Description

2.0.4 fails to build against PostgreSQL 17. v17beta2 is already out. Can you please take a look?

Thanks, Devrim

Expected Results

.

Actual Results

/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-format-truncation -O2 -I. -I./ -I/usr/pgsql-17/include/server -I/usr/pgsql-17/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -DWITH_GZFILEOP -I/usr/include -flto=thin -emit-llvm -c -o pg_stat_monitor.bc pg_stat_monitor.c pg_stat_monitor.c:1521:74: error: no member named 'blk_read_time' in 'struct BufferUsage' 1521 | e->counters.blocks.blk_read_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_read_time); | ~~~~ ^ /usr/pgsql-17/include/server/portability/instr_time.h:192:35: note: expanded from macro 'INSTR_TIME_GET_MILLISEC' 192 | ((double) INSTR_TIME_GET_NANOSEC(t) / NS_PER_MS) | ^ /usr/pgsql-17/include/server/portability/instr_time.h:126:12: note: expanded from macro 'INSTR_TIME_GET_NANOSEC' 126 | ((int64) (t).ticks) | ^ pg_stat_monitor.c:1522:75: error: no member named 'blk_write_time' in 'struct BufferUsage' 1522 | e->counters.blocks.blk_write_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_write_time); | ~~~~ ^ /usr/pgsql-17/include/server/portability/instr_time.h:192:35: note: expanded from macro 'INSTR_TIME_GET_MILLISEC' 192 | ((double) INSTR_TIME_GET_NANOSEC(t) / NS_PER_MS) | ^ /usr/pgsql-17/include/server/portability/instr_time.h:126:12: note: expanded from macro 'INSTR_TIME_GET_NANOSEC' 126 | ((int64) (t).ticks) | ^ pg_stat_monitor.c:1528:72: error: no member named 'blk_read_time' in 'struct BufferUsage' 1528 | memcpy((void ) &e->counters.blocks.instr_blk_read_time, &bufusage->blk_read_time, sizeof(instr_time)); | ~~~~ ^ pg_stat_monitor.c:1529:73: error: no member named 'blk_write_time' in 'struct BufferUsage' 1529 | memcpy((void ) &e->counters.blocks.instr_blk_write_time, &bufusage->blk_write_time, sizeof(instr_time)); | ~~~~ ^ pg_stat_monitor.c:1805:19: error: no member named 'blk_read_time' in 'struct BufferUsage' 1805 | memcpy(&bufusage.blk_read_time, &entry->counters.blocks.instr_blk_read_time, sizeof(instr_time)); | ~~~~ ^ pg_stat_monitor.c:1806:19: error: no member named 'blk_write_time' in 'struct BufferUsage' 1806 | memcpy(&bufusage.blk_write_time, &entry->counters.blocks.instr_blk_write_time, sizeof(instr_time)); | ~~~~ ^ pg_stat_monitor.c:2425:2: error: call to undeclared function 'tuplestore_donestoring'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 2425 | tuplestore_donestoring(tupstore); | ^ 7 errors generated. make[1]: [/usr/pgsql-17/lib/pgxs/src/makefiles/../../src/Makefile.global:1085: pg_stat_monitor.bc] Error 1 make[1]: Waiting for unfinished jobs.... In file included from /usr/pgsql-17/include/server/pgstat.h:15, from pg_stat_monitor.c:23: pg_stat_monitor.c: In function ‘pgsm_update_entry’: pg_stat_monitor.c:1521:95: error: ‘BufferUsage’ has no member named ‘blk_read_time’; did you mean ‘temp_blk_read_time’? 1521 | e->counters.blocks.blk_read_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_read_time); | ^~~~~ /usr/pgsql-17/include/server/portability/instr_time.h:126:19: note: in definition of macro ‘INSTR_TIME_GET_NANOSEC’ 126 | ((int64) (t).ticks) | ^ pg_stat_monitor.c:1521:61: note: in expansion of macro ‘INSTR_TIME_GET_MILLISEC’ 1521 | e->counters.blocks.blk_read_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_read_time); | ^~~~~~~ pg_stat_monitor.c:1522:96: error: ‘BufferUsage’ has no member named ‘blk_write_time’; did you mean ‘temp_blk_write_time’? 1522 | e->counters.blocks.blk_write_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_write_time); | ^~~~~~ /usr/pgsql-17/include/server/portability/instr_time.h:126:19: note: in definition of macro ‘INSTR_TIME_GET_NANOSEC’ 126 | ((int64) (t).ticks) | ^ pg_stat_monitor.c:1522:62: note: in expansion of macro ‘INSTR_TIME_GET_MILLISEC’ 1522 | e->counters.blocks.blk_write_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_write_time); | ^~~~~~~ pg_stat_monitor.c:1528:93: error: ‘BufferUsage’ has no member named ‘blk_read_time’; did you mean ‘temp_blk_read_time’? 1528 | memcpy((void ) &e->counters.blocks.instr_blk_read_time, &bufusage->blk_read_time, sizeof(instr_time)); | ^~~~~ | temp_blk_read_time pg_stat_monitor.c:1529:94: error: ‘BufferUsage’ has no member named ‘blk_write_time’; did you mean ‘temp_blk_write_time’? 1529 | memcpy((void ) &e->counters.blocks.instr_blk_write_time, &bufusage->blk_write_time, sizeof(instr_time)); | ^~~~~~ | temp_blk_write_time pg_stat_monitor.c: In function ‘pgsm_store’: pg_stat_monitor.c:1805:26: error: ‘BufferUsage’ has no member named ‘blk_read_time’; did you mean ‘temp_blk_read_time’? 1805 | memcpy(&bufusage.blk_read_time, &entry->counters.blocks.instr_blk_read_time, sizeof(instr_time)); | ^~~~~ | temp_blk_read_time pg_stat_monitor.c:1806:26: error: ‘BufferUsage’ has no member named ‘blk_write_time’; did you mean ‘temp_blk_write_time’? 1806 | memcpy(&bufusage.blk_write_time, &entry->counters.blocks.instr_blk_write_time, sizeof(instr_time)); | ^~~~~~ | temp_blk_write_time pg_stat_monitor.c: In function ‘pg_stat_monitor_internal’: pg_stat_monitor.c:2425:9: error: implicit declaration of function ‘tuplestore_donestoring’; did you mean ‘tuplestore_rescan’? [-Wimplicit-function-declaration] 2425 | tuplestore_donestoring(tupstore); | ^~~~~~ | tuplestore_rescan make[1]: *** [: pg_stat_monitor.o] Error 1

Version

PostgreSQL 17 and pg_stat_monitor 2.0.4

Steps to reproduce

No response

Relevant logs

No response

Code of Conduct

artemgavrilov commented 1 month ago

Hello @devrimgunduz ! PG 17 support not yet released or merged to the main branch. Here is the PR: https://github.com/percona/pg_stat_monitor/pull/463

Also you can track progress in this ticket: https://perconadev.atlassian.net/browse/PG-810

artemgavrilov commented 1 month ago

@devrimgunduz good news, we just merged it! I hope that in two weeks we will ship new release.

devrimgunduz commented 1 month ago

Thanks! Any update with the release?

artemgavrilov commented 1 month ago

Sorry for the delay, the release scope was a little bit changed. So in two weeks we plan to ship release candidate (without builds), but actual release (with builds) is planned to the end of August/start of September.

artemgavrilov commented 3 weeks ago

@devrimgunduz Tag 2.1.0 was added, packages will be available later.

https://github.com/percona/pg_stat_monitor/releases/tag/2.1.0