未验证 提交 0032f133 编写于 作者: X xiong-gang 提交者: GitHub

Remove FIXME in assign_gp_role

The line "if (source != PGC_S_DEFAULT)" was added a long time
ago, and there's no trace why it's added except the commit message:
"Don't set up interconnect too soon"

The 'do_connect' is true only when it's a backend process, and
there's no obvious problem setting 'gp_role' of the backend process.
Co-authored-by: NAlexandra Wang <lewang@pivotal.io>
Co-authored-by: NGang Xiong <gxiong@pivotal.io>
上级 7fc64d7e
......@@ -34,6 +34,7 @@
#include "utils/resource_manager.h"
#include "utils/resgroup-ops.h"
#include "storage/proc.h"
#include "storage/procarray.h"
#include "cdb/memquota.h"
/*
......@@ -528,32 +529,31 @@ assign_gp_role(const char *newval, void *extra)
Gp_role = newrole;
// GPDB_91_MERGE_FIXME: we don't have access to 'source' anymore
//if (source != PGC_S_DEFAULT)
if (do_connect)
{
if (do_connect)
/* Only backend process will get here */
Assert(IsBackendPid(MyProcPid));
/*
* In case there are problems with the Greenplum Database
* tables or data, we catch any error coming out of
* cdblink_setup so we can set the gp_role back to what it
* was. Otherwise we may be left with inappropriate
* connections for the new role.
*/
PG_TRY();
{
/*
* In case there are problems with the Greenplum Database
* tables or data, we catch any error coming out of
* cdblink_setup so we can set the gp_role back to what it
* was. Otherwise we may be left with inappropriate
* connections for the new role.
*/
PG_TRY();
{
cdb_setup();
}
PG_CATCH();
{
cdb_cleanup(0, 0);
Gp_role = oldrole;
if (Gp_role != GP_ROLE_UTILITY)
cdb_setup();
}
PG_CATCH();
{
cdb_cleanup(0, 0);
Gp_role = oldrole;
if (Gp_role != GP_ROLE_UTILITY)
cdb_setup();
PG_RE_THROW();
}
PG_END_TRY();
PG_RE_THROW();
}
PG_END_TRY();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册