!1010 解决自动化测试时由于多线程并发调用init_gauss_cluster_config导致coredump

Merge pull request !1010 from cchen676/new2.0
This commit is contained in:
opengauss-bot 2021-06-02 19:32:45 +08:00 committed by Gitee
commit d97c0e8a59
1 changed files with 2 additions and 1 deletions

View File

@ -1518,7 +1518,8 @@ bool check_synchronous_standby_names(char **newval, void **extra, GucSource sour
return false;
}
/* get current cluster information from cluster_staic_config */
if (strcmp(u_sess->attr.attr_common.application_name, "gsql") == 0 && has_static_config()) {
if (t_thrd.role == WORKER && strcmp(u_sess->attr.attr_common.application_name, "gsql") == 0
&& has_static_config()) {
if (0 != init_gauss_cluster_config()) {
goto pass;
}