Fix comments and error handling

pull/7254/head
EmelSimsek 2023-10-17 10:40:56 +03:00 committed by Emel Şimşek
parent b14c5a0308
commit 995cb0619a
1 changed files with 10 additions and 3 deletions

View File

@ -361,14 +361,21 @@ CitusMaintenanceDaemonMain(Datum main_arg)
{
/*
* 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.
* the state in shared memory is lost. In that case, we exit and wait
* for Postmaster calling __PG_Init which in turn calls
* InitializeMaintenanceDaemonForAdminDB.
*/
proc_exit(0);
}
if (found && myDbData->workerPid != 0)
{
/* Another maintenance daemon is running.*/
proc_exit(0);
}
if (!found)
{
/* ensure the values in MaintenanceDaemonDBData are zero */