!3619 【资源池化】解决startup线程判断reform失败出现漏判的情况
Merge pull request !3619 from 董宁/bugfix2_up
This commit is contained in:
@ -100,11 +100,6 @@ bool SSRecoveryNodes()
|
||||
{
|
||||
bool result = false;
|
||||
while (true) {
|
||||
if (dms_reform_failed()) {
|
||||
SSWaitStartupExit();
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
/** why use lock:
|
||||
* time1 startup thread: update IsRecoveryDone, not finish UpdateControlFile
|
||||
* time2 reform_proc: finish reform, think ControlFile is ok
|
||||
@ -134,6 +129,12 @@ bool SSRecoveryNodes()
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (dms_reform_failed()) {
|
||||
SSWaitStartupExit();
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
pg_usleep(REFORM_WAIT_TIME);
|
||||
}
|
||||
return result;
|
||||
|
||||
@ -486,13 +486,7 @@ void DMSUninit()
|
||||
int32 DMSWaitReform()
|
||||
{
|
||||
uint32 has_offline; /* currently not used in openGauss */
|
||||
int ret = dms_wait_reform(&has_offline);
|
||||
if (ret) {
|
||||
while (g_instance.dms_cxt.SSReformInfo.in_reform) {
|
||||
pg_usleep(5000L);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
return dms_wait_reform(&has_offline);
|
||||
}
|
||||
|
||||
static bool DMSReformCheckStartup()
|
||||
@ -530,4 +524,15 @@ bool DMSWaitInitStartup()
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void StartupWaitReform()
|
||||
{
|
||||
while (g_instance.dms_cxt.SSReformInfo.in_reform) {
|
||||
if (dms_reform_failed() || dms_reform_last_failed()) {
|
||||
ereport(LOG, (errmsg("[SS reform] reform failed, startup no need wait.")));
|
||||
break;
|
||||
}
|
||||
pg_usleep(5000L);
|
||||
}
|
||||
}
|
||||
@ -10563,7 +10563,7 @@ void StartupXLOG(void)
|
||||
#endif
|
||||
|
||||
if (ENABLE_DMS && ENABLE_REFORM && !SS_PRIMARY_DEMOTED && !DORADO_STANDBY_CLUSTER) {
|
||||
DMSWaitReform();
|
||||
StartupWaitReform();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -44,5 +44,6 @@ bool DMSWaitInitStartup();
|
||||
void DMSInitLogger();
|
||||
void DMSRefreshLogger(char *log_field, unsigned long long *value);
|
||||
void GetSSLogPath(char *sslog_path);
|
||||
void StartupWaitReform();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user