提交 434bd5b9 编写于 作者: A Ashwin Agrawal

Set needToPromoteCatalog before updating ControlFile->state.

Commit 6d80ce31 moved updating the
control file state above, which caused failure in CI for
gpactivatestandby test. As catalog update got missed since
needToPromoteCatalog remained set as false. Hence, move setting
needToPromoteCatalog before setting the ControlFile->state.
上级 cb256d04
......@@ -7688,6 +7688,15 @@ StartupXLOG(void)
*/
InRecovery = false;
/*
* If we are a standby with contentid -1 and undergoing promotion,
* update ourselves as the new master in catalog. This does not
* apply to a mirror (standby of a GPDB segment) because it is
* managed by FTS.
*/
bool needToPromoteCatalog = (IS_QUERY_DISPATCHER() &&
ControlFile->state == DB_IN_ARCHIVE_RECOVERY);
LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
ControlFile->state = DB_IN_PRODUCTION;
ControlFile->time = (pg_time_t) time(NULL);
......@@ -7727,15 +7736,6 @@ StartupXLOG(void)
/* Reload shared-memory state for prepared transactions */
RecoverPreparedTransactions();
/*
* If we are a standby with contentid -1 and undergoing promotion,
* update ourselves as the new master in catalog. This does not
* apply to a mirror (standby of a GPDB segment) because it is
* managed by FTS.
*/
bool needToPromoteCatalog = (IS_QUERY_DISPATCHER() &&
ControlFile->state == DB_IN_ARCHIVE_RECOVERY);
ereport(LOG, (errmsg("database system is ready")));
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册