Skip to content

Commit 63521cd

Browse files
committed
Add cfs_enable_gc GUC variable
1 parent 92d1f9f commit 63521cd

File tree

1 file changed

+24
-0
lines changed
  • src/backend/utils/misc

1 file changed

+24
-0
lines changed

src/backend/utils/misc/guc.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ static void assign_application_name(const char *newval, void *extra);
186186
static bool check_cluster_name(char **newval, void **extra, GucSource source);
187187
static const char *show_unix_socket_permissions(void);
188188
static const char *show_log_file_mode(void);
189+
static void set_cfs_gc_enabled(bool newval, void* extra);
190+
static char const* show_cfs_gc_enabled(void);
189191

190192
/* Private functions in guc-file.l that need to be called from guc.c */
191193
static ConfigVariable *ProcessConfigFileInternal(GucContext context,
@@ -446,6 +448,7 @@ bool row_security;
446448
bool check_function_bodies = true;
447449
bool default_with_oids = false;
448450
bool SQL_inheritance = true;
451+
bool cfs_gc_enabled = true;
449452

450453
int log_min_error_statement = ERROR;
451454
int log_min_messages = WARNING;
@@ -1689,6 +1692,16 @@ static struct config_bool ConfigureNamesBool[] =
16891692
NULL, NULL, NULL
16901693
},
16911694

1695+
{
1696+
{"cfs_enable_gc", PGC_USERSET, UNGROUPED,
1697+
gettext_noop("Enable garbage collection of compressed pages"),
1698+
NULL,
1699+
},
1700+
&cfs_gc_enabled,
1701+
true,
1702+
NULL, set_cfs_gc_enabled, show_cfs_gc_enabled
1703+
},
1704+
16921705
{
16931706
{"cfs_gc_verify_file", PGC_USERSET, UNGROUPED,
16941707
gettext_noop("Verify correctness of data written by GC"),
@@ -10842,4 +10855,15 @@ show_log_file_mode(void)
1084210855
return buf;
1084310856
}
1084410857

10858+
static void set_cfs_gc_enabled(bool newval, void* extra)
10859+
{
10860+
cfs_control_gc(newval);
10861+
}
10862+
10863+
static char const* show_cfs_gc_enabled(void)
10864+
{
10865+
return cfs_state && cfs_state->gc_enabled ? "true" : "false";
10866+
}
10867+
10868+
1084510869
#include "guc-file.c"

0 commit comments

Comments
 (0)