Re: [HACKERS] max backends checking patch
От | Vadim Mikheev |
---|---|
Тема | Re: [HACKERS] max backends checking patch |
Дата | |
Msg-id | 3698B980.EB62133A@krs.ru обсуждение исходный текст |
Ответ на | max backends checking patch (Tatsuo Ishii <t-ishii@sra.co.jp>) |
Ответы |
Re: [HACKERS] max backends checking patch
|
Список | pgsql-hackers |
Tatsuo Ishii wrote: > > As of 6.4.2 (and snapshot, I guess), postmaser does not check if the > number of backends exceeds MaxBackendId (defined in > include/storage/sinvaladt.h). As a result (MaxBackendId+1)th backend > gets started but failed in the middle of its initialising process. > Typical error would be: > > NOTICE: SIAssignBackendId: discarding tag 2147430138 > Connection databese 'request' failed. > FATAL 1: Backend cache invalidation initialization failed > > Then postmaster decides to re-initialize the shared memory and all > running backends are killed. Too bad. > > Attached patches try to fix the problem. Couldn't postmaster just keep # of backends running in some variable, instead of examining BackendList ? > + /* > + * Count up number of chidren processes. > + */ > + static int > + CountChildren(void) > + { > + Dlelem *curr, > + *next; > + Backend *bp; > + int mypid = getpid(); > + int cnt = 0; > + > + curr = DLGetHead(BackendList); > + while (curr) > + { > + next = DLGetSucc(curr); > + bp = (Backend *) DLE_VAL(curr); > + > + if (bp->pid != mypid) > + { > + cnt++; > + } > + > + curr = next; > + } > + return(cnt); > } Vadim
В списке pgsql-hackers по дате отправления: