Exit maintenanced on database crash

pull/1585/head
Marco Slot 2017-08-16 18:29:44 +02:00
parent a5d54382ef
commit 1eca53ad40
1 changed files with 7 additions and 2 deletions

View File

@ -212,8 +212,13 @@ CitusMaintenanceDaemonMain(Datum main_arg)
HASH_FIND, NULL); HASH_FIND, NULL);
if (!myDbData) 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); LWLockRelease(&MaintenanceDaemonControl->lock);