diff --git a/pgxn/neon/neon.c b/pgxn/neon/neon.c index 700a942284..768d7ae9e8 100644 --- a/pgxn/neon/neon.c +++ b/pgxn/neon/neon.c @@ -12,6 +12,7 @@ #include "fmgr.h" #include "miscadmin.h" +#include "pgstat.h" #include "access/subtrans.h" #include "access/twophase.h" #include "access/xlog.h" @@ -410,6 +411,16 @@ ReportSearchPath(void) } } +#if PG_VERSION_NUM < 150000 +/* + * PG14 uses separate backend for stats collector having no access to shared memory. + * As far as AUX mechanism requires access to shared memory, persisting pgstat.stat file + * is not supported in PG14. And so there is no definition of neon_pgstat_file_size_limit + * variable, so we have to declare it here. + */ +static int neon_pgstat_file_size_limit; +#endif + void _PG_init(void) { @@ -467,6 +478,15 @@ _PG_init(void) 0, NULL, NULL, NULL); + DefineCustomIntVariable("neon.pgstat_file_size_limit", + "Maximal size of pgstat.stat file saved in Neon storage", + "Zero value disables persisting pgstat.stat file", + &neon_pgstat_file_size_limit, + 0, 0, 1000000, /* disabled by default */ + PGC_SIGHUP, + GUC_UNIT_KB, + NULL, NULL, NULL); + /* * Important: This must happen after other parts of the extension are * loaded, otherwise any settings to GUCs that were set before the diff --git a/test_runner/regress/test_pgstat.py b/test_runner/regress/test_pgstat.py index c31e5ef7f8..bf9b982e14 100644 --- a/test_runner/regress/test_pgstat.py +++ b/test_runner/regress/test_pgstat.py @@ -13,7 +13,7 @@ def test_pgstat(neon_simple_env: NeonEnv): n = 10000 endpoint = env.endpoints.create_start( - "main", config_lines=["neon_pgstat_file_size_limit=100kB", "autovacuum=off"] + "main", config_lines=["neon.pgstat_file_size_limit=100kB", "autovacuum=off"] ) con = endpoint.connect() diff --git a/vendor/postgres-v15 b/vendor/postgres-v15 index 6ff5044377..9b118b1cff 160000 --- a/vendor/postgres-v15 +++ b/vendor/postgres-v15 @@ -1 +1 @@ -Subproject commit 6ff50443773b69749e16da6db9d4f4b19064b4b7 +Subproject commit 9b118b1cffa6e4ca0d63389b57b54d11e207e9a8 diff --git a/vendor/postgres-v16 b/vendor/postgres-v16 index 261ed10e9b..799e7a08dd 160000 --- a/vendor/postgres-v16 +++ b/vendor/postgres-v16 @@ -1 +1 @@ -Subproject commit 261ed10e9b8c8dda01ad7aefb18e944e30aa161d +Subproject commit 799e7a08dd171aa06a7395dd326f4243aaeb9f93 diff --git a/vendor/postgres-v17 b/vendor/postgres-v17 index 59b2fe851f..517b8dc244 160000 --- a/vendor/postgres-v17 +++ b/vendor/postgres-v17 @@ -1 +1 @@ -Subproject commit 59b2fe851f8e0595f6c830b90ee766f4f1c17a0f +Subproject commit 517b8dc244abf3e56f0089849e464af76f70b94e diff --git a/vendor/revisions.json b/vendor/revisions.json index f85cec3a0b..8dde46a01e 100644 --- a/vendor/revisions.json +++ b/vendor/revisions.json @@ -1,15 +1,15 @@ { "v17": [ "17.4", - "59b2fe851f8e0595f6c830b90ee766f4f1c17a0f" + "517b8dc244abf3e56f0089849e464af76f70b94e" ], "v16": [ "16.8", - "261ed10e9b8c8dda01ad7aefb18e944e30aa161d" + "799e7a08dd171aa06a7395dd326f4243aaeb9f93" ], "v15": [ "15.12", - "6ff50443773b69749e16da6db9d4f4b19064b4b7" + "9b118b1cffa6e4ca0d63389b57b54d11e207e9a8" ], "v14": [ "14.17",