mirror of
https://github.com/neondatabase/neon.git
synced 2026-10-12 14:53:00 +00:00
Move neon_pgstat_file_size_limit to the extension (#10959)
## Problem PG14 uses separate backend for stats collector having no access to shaerd memory. As far as AUX mechanism requires access to shared memory, persisting pgstat.stat file is not supported at pg14. And so there is no definition of `neon_pgstat_file_size_limit` variable. It makes it impossible to provide same config for all Postgres version. ## Summary of changes Move neon_pgstat_file_size_limit to Neon extension. Postgres submodules PR: https://github.com/neondatabase/postgres/pull/587 https://github.com/neondatabase/postgres/pull/588 https://github.com/neondatabase/postgres/pull/589 --------- Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech> Co-authored-by: Tristan Partin <tristan@neon.tech>
This commit is contained in:
co-authored by
Konstantin Knizhnik
Tristan Partin
parent
758f597280
commit
8f82c661d4
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Vendored
+1
-1
Submodule vendor/postgres-v15 updated: 6ff5044377...9b118b1cff
Vendored
+1
-1
Submodule vendor/postgres-v16 updated: 261ed10e9b...799e7a08dd
Vendored
+1
-1
Submodule vendor/postgres-v17 updated: 59b2fe851f...517b8dc244
Vendored
+3
-3
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"v17": [
|
||||
"17.4",
|
||||
"59b2fe851f8e0595f6c830b90ee766f4f1c17a0f"
|
||||
"517b8dc244abf3e56f0089849e464af76f70b94e"
|
||||
],
|
||||
"v16": [
|
||||
"16.8",
|
||||
"261ed10e9b8c8dda01ad7aefb18e944e30aa161d"
|
||||
"799e7a08dd171aa06a7395dd326f4243aaeb9f93"
|
||||
],
|
||||
"v15": [
|
||||
"15.12",
|
||||
"6ff50443773b69749e16da6db9d4f4b19064b4b7"
|
||||
"9b118b1cffa6e4ca0d63389b57b54d11e207e9a8"
|
||||
],
|
||||
"v14": [
|
||||
"14.17",
|
||||
|
||||
Reference in New Issue
Block a user