diff --git a/control_plane/src/endpoint.rs b/control_plane/src/endpoint.rs index 3b033b32fd..c49e1efb0c 100644 --- a/control_plane/src/endpoint.rs +++ b/control_plane/src/endpoint.rs @@ -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 { diff --git a/pgxn/neon/neon.c b/pgxn/neon/neon.c index b930fdb3ca..b115e641e1 100644 --- a/pgxn/neon/neon.c +++ b/pgxn/neon/neon.c @@ -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 diff --git a/vendor/postgres-v14 b/vendor/postgres-v14 index 23a19fe0a4..7eb44da047 160000 --- a/vendor/postgres-v14 +++ b/vendor/postgres-v14 @@ -1 +1 @@ -Subproject commit 23a19fe0a4f6e56f4540afabe6825281c9d02cd1 +Subproject commit 7eb44da047e68cf6785d27388c482abd02fe2a2d diff --git a/vendor/postgres-v15 b/vendor/postgres-v15 index d4d552ce42..e2a0a8aa75 160000 --- a/vendor/postgres-v15 +++ b/vendor/postgres-v15 @@ -1 +1 @@ -Subproject commit d4d552ce42e40f29909f1c6613c57ecda6ea6933 +Subproject commit e2a0a8aa75ff2fa70af87cb86ba6fb7f575e3155 diff --git a/vendor/postgres-v16 b/vendor/postgres-v16 index 0d4eb408a1..3f96a5b0c7 160000 --- a/vendor/postgres-v16 +++ b/vendor/postgres-v16 @@ -1 +1 @@ -Subproject commit 0d4eb408a1242f8564ba2bfa57a1ea601dc99a4c +Subproject commit 3f96a5b0c70e48b9142f0c9b496c7c04c93bec8b diff --git a/vendor/revisions.json b/vendor/revisions.json index 37457e56ee..c862888bc9 100644 --- a/vendor/revisions.json +++ b/vendor/revisions.json @@ -1,5 +1,5 @@ { - "postgres-v16": "0d4eb408a1242f8564ba2bfa57a1ea601dc99a4c", - "postgres-v15": "d4d552ce42e40f29909f1c6613c57ecda6ea6933", - "postgres-v14": "23a19fe0a4f6e56f4540afabe6825281c9d02cd1" + "postgres-v16": "3f96a5b0c70e48b9142f0c9b496c7c04c93bec8b", + "postgres-v15": "e2a0a8aa75ff2fa70af87cb86ba6fb7f575e3155", + "postgres-v14": "7eb44da047e68cf6785d27388c482abd02fe2a2d" }