Merge pull request #1585 from citusdata/exit_maintenanced

Maintenance daemon dies peacefully when it gets lost finding itself
pull/1549/merge
Marco Slot 2017-08-17 09:11:27 +02:00 committed by GitHub
commit 131baeda3d
1 changed files with 7 additions and 2 deletions

View File

@ -212,8 +212,13 @@ CitusMaintenanceDaemonMain(Datum main_arg)
HASH_FIND, NULL);
if (!myDbData)
{
/* should never happen */
ereport(ERROR, (errmsg("got lost finding myself")));
/*
* When the database crashes, background workers are restarted, but
* the state in shared memory is lost. In that case, we exit and
* wait for a session to call InitializeMaintenanceDaemonBackend
* to properly add it to the hash.
*/
proc_exit(0);
}
LWLockRelease(&MaintenanceDaemonControl->lock);