diff --git a/src/common/backend/utils/misc/guc/guc_storage.cpp b/src/common/backend/utils/misc/guc/guc_storage.cpp index d88ef70ff958c6edd15ef1a602174d82f569f027..7640322df2624bff68ea2df415a5f9f474241900 100755 --- a/src/common/backend/utils/misc/guc/guc_storage.cpp +++ b/src/common/backend/utils/misc/guc/guc_storage.cpp @@ -214,6 +214,8 @@ static bool check_and_assign_namespace_oids(List* elemlist); static bool check_and_assign_general_oids(List* elemlist); static int GetLengthAndCheckReplConn(const char* ConnInfoList); +static bool check_most_available_sync_param(bool* newval, void** extra, GucSource source); + static bool check_ss_interconnect_url(char **newval, void **extra, GucSource source); static bool check_ss_ock_log_path(char **newval, void **extra, GucSource source); static bool check_ss_interconnect_type(char **newval, void **extra, GucSource source); @@ -277,6 +279,7 @@ static bool check_logical_decode_options_default(char** newval, void** extra, Gu static void assign_logical_decode_options_default(const char* newval, void* extra); static bool check_uwal_devices_path(char** newval, void** extra, GucSource source); static bool check_uwal_log_path(char** newval, void** extra, GucSource source); +static bool check_enable_uwal(bool* newval, void** extra, GucSource source); static void assign_recovery_parallelism(int newval, void* extra); static const struct config_enum_entry resource_track_log_options[] = { @@ -811,7 +814,7 @@ static void InitStorageConfigureNamesBool() }, &u_sess->attr.attr_storage.guc_most_available_sync, false, - NULL, + check_most_available_sync_param, NULL, NULL}, {{"enable_show_any_tuples", @@ -1380,7 +1383,7 @@ static void InitStorageConfigureNamesBool() NULL}, &g_instance.attr.attr_storage.enable_uwal, false, - NULL, + check_enable_uwal, NULL, NULL}, {{"uwal_rpc_compression_switch", @@ -6582,6 +6585,18 @@ static int GetLengthAndCheckReplConn(const char* ConnInfoList) return repl_len; } +static bool check_most_available_sync_param(bool* newval, void** extra, GucSource source) +{ + if (source == PGC_S_DEFAULT) { + return true; + } + if (*newval && g_instance.attr.attr_storage.enable_uwal) { + ereport(ERROR, (errmsg("Do not allow both enable uwal and most_available_sync"))); + return false; + } + return true; +} + static bool check_ss_interconnect_type(char **newval, void **extra, GucSource source) { return (strcmp("TCP", *newval) == 0 || strcmp("RDMA", *newval) == 0); @@ -7139,6 +7154,18 @@ static bool check_uwal_log_path(char **newval, void **extra, GucSource source) return true; } +static bool check_enable_uwal(bool* newval, void** extra, GucSource source) +{ + if (source == PGC_S_DEFAULT) { + return true; + } + if (*newval && u_sess->attr.attr_storage.guc_most_available_sync) { + ereport(ERROR, (errmsg("Do not allow both enable uwal and most_available_sync"))); + return false; + } + return true; +} + static bool check_ss_work_thread_pool_attr(char** newval, void** extra, GucSource source) { if (newval == NULL || *newval == NULL || **newval == '\0') { diff --git a/src/gausskernel/storage/gs_uwal/gs_uwal.cpp b/src/gausskernel/storage/gs_uwal/gs_uwal.cpp index c027df8af2a9eecf2c9bc1725c6d2c2d5a531d9c..73d8b663275da450f592ae500c2897ee54d127a3 100644 --- a/src/gausskernel/storage/gs_uwal/gs_uwal.cpp +++ b/src/gausskernel/storage/gs_uwal/gs_uwal.cpp @@ -448,6 +448,11 @@ int GsUwalInit(ServerMode serverMode) } } + if ((volatile bool)u_sess->attr.attr_storage.guc_most_available_sync) { + ereport(ERROR, (errmsg("uwal only support most_available_sync is 'off'"))); + return ret; + } + if (GsUwalLoadSymbols() != 0) { ereport(ERROR, (errmsg("failed to dlopen libuwal.so"))); return ret;