diff --git a/src/common/backend/utils/misc/guc/guc_storage.cpp b/src/common/backend/utils/misc/guc/guc_storage.cpp index 201158166..418bf997a 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); @@ -811,7 +813,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", @@ -6568,6 +6570,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); diff --git a/src/gausskernel/storage/gs_uwal/gs_uwal.cpp b/src/gausskernel/storage/gs_uwal/gs_uwal.cpp index c027df8af..73d8b6632 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;