1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-28 11:44:57 +03:00

Add GUC to show EXEC_BACKEND state

There is no straightforward way to determine if a cluster is running
in EXEC_BACKEND mode or not, which is useful for tests to know. This
adds a GUC debug_exec_backend similar to debug_assertions which will
be true when the server is running in EXEC_BACKEND mode.

Author: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/5F301096-921A-427D-8EC1-EBAEC2A35082@yesql.se
This commit is contained in:
Daniel Gustafsson
2025-11-26 14:24:27 +01:00
parent 0f4f45772c
commit b3fe098d33
3 changed files with 31 additions and 0 deletions

View File

@@ -617,6 +617,13 @@
max => 'MAX_DEBUG_DISCARD_CACHES',
},
{ name => 'debug_exec_backend', type => 'bool', context => 'PGC_INTERNAL', group => 'PRESET_OPTIONS',
short_desc => 'Shows whether the running server is built with EXEC_BACKEND enabled.',
flags => 'GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE',
variable => 'exec_backend_enabled',
boot_val => 'EXEC_BACKEND_ENABLED',
},
{ name => 'debug_io_direct', type => 'string', context => 'PGC_POSTMASTER', group => 'DEVELOPER_OPTIONS',
short_desc => 'Use direct I/O for file access.',
long_desc => 'An empty string disables direct I/O.',

View File

@@ -627,6 +627,13 @@ static bool integer_datetimes;
#endif
static bool assert_enabled = DEFAULT_ASSERT_ENABLED;
#ifdef EXEC_BACKEND
#define EXEC_BACKEND_ENABLED true
#else
#define EXEC_BACKEND_ENABLED false
#endif
static bool exec_backend_enabled = EXEC_BACKEND_ENABLED;
static char *recovery_target_timeline_string;
static char *recovery_target_string;
static char *recovery_target_xid_string;