From: Pavan Deolasee Date: Mon, 15 Feb 2016 12:50:44 +0000 (+0530) Subject: Make sure to write to the GTM control file only after paths are set up X-Git-Tag: XL9_5_R1BETA1~17 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=0f2b72e50b76a0f9704ec527a70f922da4b5ca64;p=postgres-xl.git Make sure to write to the GTM control file only after paths are set up correctly --- diff --git a/src/gtm/main/main.c b/src/gtm/main/main.c index 123350029e..c0b3832123 100644 --- a/src/gtm/main/main.c +++ b/src/gtm/main/main.c @@ -193,9 +193,6 @@ InitGTMProcess() MyThreadID = pthread_self(); MemoryContextInit(); - /* Backup the restore point */ - GTM_WriteRestorePoint(); - /* * The memory context is now set up. * Add the thrinfo structure in the global array @@ -706,6 +703,10 @@ main(int argc, char *argv[]) GTM_MutexLockRelease(&control_lock); } + /* Backup the restore point */ + GTM_SetNeedBackup(); + GTM_WriteRestorePoint(); + if (Recovery_IsStandby()) { if (!gtm_standby_register_self(NodeName, GTMPortNumber, GTMDataDir)) @@ -2230,6 +2231,8 @@ PromoteToActive(void) errmsg("could not close GTM configuration file \"%s\": %m", conf_file))); } + GTM_SetNeedBackup(); + GTM_WriteRestorePoint(); return; }