解决dorado sharestorage init失败的问题
This commit is contained in:
@ -1787,6 +1787,11 @@ static int CBMarkNeedFlush(void *db_handle, char *pageid)
|
||||
|
||||
void DmsCallbackThreadShmemInit(unsigned char need_startup, char **reg_data)
|
||||
{
|
||||
/* in dorado mode, we need to wait sharestorageinit finished */
|
||||
while (!g_instance.dms_cxt.SSRecoveryInfo.dorado_sharestorage_inited &&
|
||||
g_instance.attr.attr_storage.xlog_file_path != 0) {
|
||||
pg_usleep(REFORM_WAIT_TIME);
|
||||
}
|
||||
IsUnderPostmaster = true;
|
||||
// to add cnt, avoid postmain execute proc_exit to free shmem now
|
||||
(void)pg_atomic_add_fetch_u32(&g_instance.dms_cxt.inDmsThreShmemInitCnt, 1);
|
||||
|
||||
@ -193,6 +193,7 @@ static void knl_g_dms_init(knl_g_dms_context *dms_cxt)
|
||||
dms_cxt->SSRecoveryInfo.in_ondemand_recovery = false;
|
||||
dms_cxt->SSRecoveryInfo.startup_need_exit_normally = false;
|
||||
dms_cxt->SSRecoveryInfo.recovery_trapped_in_page_request = false;
|
||||
dms_cxt->SSRecoveryInfo.dorado_sharestorage_inited = false;
|
||||
dms_cxt->log_timezone = NULL;
|
||||
pg_atomic_init_u32(&dms_cxt->inDmsThreShmemInitCnt, 0);
|
||||
pg_atomic_init_u32(&dms_cxt->inProcExitCnt, 0);
|
||||
|
||||
@ -18735,6 +18735,10 @@ void ShareStorageInit()
|
||||
securec_check_ss(errorno, "", "");
|
||||
UpdatePostgresqlFile("xlog_file_size", option);
|
||||
}
|
||||
|
||||
if (ENABLE_DMS) {
|
||||
g_instance.dms_cxt.SSRecoveryInfo.dorado_sharestorage_inited = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -87,6 +87,7 @@ typedef struct ss_recovery_info {
|
||||
bool startup_need_exit_normally; //used in alive failover
|
||||
bool recovery_trapped_in_page_request; //used in alive failover
|
||||
bool in_ondemand_recovery;
|
||||
bool dorado_sharestorage_inited; // used in dorado mode
|
||||
} ss_recovery_info_t;
|
||||
|
||||
extern bool SSRecoveryNodes();
|
||||
|
||||
Reference in New Issue
Block a user