diff options
author | Pavan Deolasee | 2016-02-15 12:50:44 +0000 |
---|---|---|
committer | Pavan Deolasee | 2016-10-18 09:58:30 +0000 |
commit | ccad4af795c0dc00b216573426455d2e12f2191f (patch) | |
tree | 344448ab817eeb26a16bd884c6e0af78b14d86fa | |
parent | 4c3bb336a23213c438ed52bff65b04d92f911885 (diff) |
Make sure to write to the GTM control file only after paths are set up
correctly
-rw-r--r-- | src/gtm/main/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
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; } |