fix bug about verify parameter of gs_initdb
This commit is contained in:
@ -4292,7 +4292,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
/* check nodedata.cfg and node_id */
|
||||
ss_issharedstorage = ss_check_nodedatainfo();
|
||||
ss_issharedstorage = ss_check_nodedatainfo(enable_dss);
|
||||
|
||||
if (default_text_search_config_tmp != NULL)
|
||||
default_text_search_config = default_text_search_config_tmp;
|
||||
|
@ -146,14 +146,20 @@ void pg_ltoa(int32 value, char *a)
|
||||
}
|
||||
|
||||
/* check dms url when gs_initdb */
|
||||
bool ss_check_nodedatainfo()
|
||||
{
|
||||
bool ss_check_nodedatainfo(bool enable_dss)
|
||||
{
|
||||
bool issharedstorage = false;
|
||||
|
||||
if ((ss_nodeid == INVALID_INSTANCEID && ss_nodedatainfo != NULL) ||
|
||||
(ss_nodeid != INVALID_INSTANCEID && ss_nodedatainfo == NULL)) {
|
||||
issharedstorage = false;
|
||||
fprintf(stderr, _("ss_nodeid is invalid or nodedatainfo file not exist or nodedatainfo file is empty.\n"));
|
||||
if (!enable_dss) {
|
||||
if (ss_nodeid != INVALID_INSTANCEID || ss_nodedatainfo != NULL) {
|
||||
fprintf(stderr, _("ss_nodeid is valid or nodedatainfo exist without enable-dss.\n"));
|
||||
exit(1);
|
||||
}
|
||||
return issharedstorage;
|
||||
}
|
||||
|
||||
if ((ss_nodeid == INVALID_INSTANCEID || ss_nodedatainfo == NULL)) {
|
||||
fprintf(stderr, _("ss_nodeid is invalid or nodedatainfo not exist or nodedatainfo is empty with enable-dss.\n"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ extern bool ss_issharedstorage;
|
||||
extern bool ss_need_mkclusterdir;
|
||||
|
||||
/* check dms url when gs_initdb */
|
||||
extern bool ss_check_nodedatainfo();
|
||||
extern bool ss_check_nodedatainfo(bool enable_dss);
|
||||
extern bool ss_check_existclusterdir(const char* path);
|
||||
extern bool ss_check_shareddir(char* path);
|
||||
extern void ss_createdir(const char** ss_dirs, int32 num, int32 node_id, const char* pg_data, const char* vgdata_dir, const char* vglog_dir);
|
||||
|
@ -232,7 +232,7 @@ void SSWriteReformerControlPages(void)
|
||||
if (g_instance.dms_cxt.SSReformerControl.list_stable != 0 ||
|
||||
g_instance.dms_cxt.SSReformerControl.primaryInstId == SS_MY_INST_ID) {
|
||||
(void)printf("[SS] ERROR: files from last install must be cleared.\n");
|
||||
ereport(PANIC, (errmsg("Files from last initdb not cleared")));
|
||||
ereport(ERROR, (errmsg("Files from last initdb not cleared")));
|
||||
}
|
||||
(void)printf("[SS] Current node:%d acknowledges cluster PRIMARY node:%d.\n",
|
||||
SS_MY_INST_ID, g_instance.dms_cxt.SSReformerControl.primaryInstId);
|
||||
|
Reference in New Issue
Block a user