mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 17:32:56 +00:00
Use neon.primary_is_running GUC for replica startup
This commit is contained in:
@@ -307,6 +307,9 @@ impl Endpoint {
|
||||
// Load the 'neon' extension
|
||||
conf.append("shared_preload_libraries", "neon");
|
||||
|
||||
// It is only for testing, in real environment this GUC is passed by control plane
|
||||
conf.append("neon.primary_is_running", "on");
|
||||
|
||||
conf.append_line("");
|
||||
// Replication-related configurations, such as WAL sending
|
||||
match &self.mode {
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
PG_MODULE_MAGIC;
|
||||
void _PG_init(void);
|
||||
|
||||
bool primary_is_running = false;
|
||||
|
||||
void
|
||||
_PG_init(void)
|
||||
{
|
||||
@@ -48,6 +50,16 @@ _PG_init(void)
|
||||
|
||||
pg_init_extension_server();
|
||||
|
||||
DefineCustomBoolVariable(
|
||||
"neon.primary_is_running",
|
||||
"For replica it is true, if primary is running, false otherwise",
|
||||
NULL,
|
||||
&primary_is_running,
|
||||
false,
|
||||
PGC_POSTMASTER,
|
||||
0,
|
||||
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
|
||||
|
||||
2
vendor/postgres-v14
vendored
2
vendor/postgres-v14
vendored
Submodule vendor/postgres-v14 updated: 23a19fe0a4...7eb44da047
2
vendor/postgres-v15
vendored
2
vendor/postgres-v15
vendored
Submodule vendor/postgres-v15 updated: d4d552ce42...e2a0a8aa75
2
vendor/postgres-v16
vendored
2
vendor/postgres-v16
vendored
Submodule vendor/postgres-v16 updated: 0d4eb408a1...3f96a5b0c7
6
vendor/revisions.json
vendored
6
vendor/revisions.json
vendored
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"postgres-v16": "0d4eb408a1242f8564ba2bfa57a1ea601dc99a4c",
|
||||
"postgres-v15": "d4d552ce42e40f29909f1c6613c57ecda6ea6933",
|
||||
"postgres-v14": "23a19fe0a4f6e56f4540afabe6825281c9d02cd1"
|
||||
"postgres-v16": "3f96a5b0c70e48b9142f0c9b496c7c04c93bec8b",
|
||||
"postgres-v15": "e2a0a8aa75ff2fa70af87cb86ba6fb7f575e3155",
|
||||
"postgres-v14": "7eb44da047e68cf6785d27388c482abd02fe2a2d"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user