Streaming replication and postmaster signaling

Поиск
Список
Период
Сортировка
Искать
От
Heikki Linnakangas
Тема
Streaming replication and postmaster signaling
Дата
Msg-id
4B434795.5080305@enterprisedb.com
Список
Дерево обсуждения
Streaming replication and postmaster signaling Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: Streaming replication and postmaster signaling Alvaro Herrera <alvherre@commandprompt.com>
Re: Streaming replication and postmaster signaling Fujii Masao <masao.fujii@gmail.com>
Re: Streaming replication and postmaster signaling Craig Ringer <craig@postnewspapers.com.au>
Re: Streaming replication and postmaster signaling Tom Lane <tgl@sss.pgh.pa.us>
Re: Streaming replication and postmaster signaling Fujii Masao <masao.fujii@gmail.com>
Re: Streaming replication and postmaster signaling Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: Streaming replication and postmaster signaling Robert Haas <robertmhaas@gmail.com>
Re: Streaming replication and postmaster signaling Devrim GÜNDÜZ <devrim@gunduz.org>
Re: Streaming replication and postmaster signaling Magnus Hagander <magnus@hagander.net>
Re: Streaming replication and postmaster signaling Andres Freund <andres@anarazel.de>
Re: Streaming replication and postmaster signaling Tom Lane <tgl@sss.pgh.pa.us>
Re: Streaming replication and postmaster signaling Robert Haas <robertmhaas@gmail.com>
Re: Streaming replication and postmaster signaling Tom Lane <tgl@sss.pgh.pa.us>
Re: Streaming replication and postmaster signaling Bruce Momjian <bruce@momjian.us>
Re: Streaming replication and postmaster signaling Robert Haas <robertmhaas@gmail.com>
Re: Streaming replication and postmaster signaling Robert Haas <robertmhaas@gmail.com>
Re: Streaming replication and postmaster signaling Tom Lane <tgl@sss.pgh.pa.us>
Re: Streaming replication and postmaster signaling Josh Berkus <josh@agliodbs.com>
Re: Streaming replication and postmaster signaling Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: Streaming replication and postmaster signaling Tom Lane <tgl@sss.pgh.pa.us>
Re: Streaming replication and postmaster signaling Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: Streaming replication and postmaster signaling "David E. Wheeler" <david@kineticode.com>
Re: Streaming replication and postmaster signaling Robert Haas <robertmhaas@gmail.com>
Re: Streaming replication and postmaster signaling Tom Lane <tgl@sss.pgh.pa.us>
Re: Streaming replication and postmaster signaling Robert Haas <robertmhaas@gmail.com>
Re: Streaming replication and postmaster signaling Tom Lane <tgl@sss.pgh.pa.us>
Re: Streaming replication and postmaster signaling Dimitri Fontaine <dfontaine@hi-media.com>
Re: Streaming replication and postmaster signaling Dave Page <dpage@pgadmin.org>
Re: Streaming replication and postmaster signaling Josh Berkus <josh@agliodbs.com>
Re: Streaming replication and postmaster signaling Dave Page <dpage@pgadmin.org>
Re: Streaming replication and postmaster signaling "Greg Sabino Mullane" <greg@turnstep.com>
Re: Streaming replication and postmaster signaling Tom Lane <tgl@sss.pgh.pa.us>
Re: Streaming replication and postmaster signaling Magnus Hagander <magnus@hagander.net>
Re: Streaming replication and postmaster signaling Tom Lane <tgl@sss.pgh.pa.us>
Re: Streaming replication and postmaster signaling Bruce Momjian <bruce@momjian.us>
Re: Streaming replication and postmaster signaling David Fetter <david@fetter.org>
Re: Streaming replication and postmaster signaling Alvaro Herrera <alvherre@commandprompt.com>
Re: Streaming replication and postmaster signaling Andrew Dunstan <andrew@dunslane.net>
Re: Streaming replication and postmaster signaling Devrim GÜNDÜZ <devrim@gunduz.org>
Re: Streaming replication and postmaster signaling Dimitri Fontaine <dfontaine@hi-media.com>
Re: Streaming replication and postmaster signaling Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
Re: Streaming replication and postmaster signaling "Greg Sabino Mullane" <greg@turnstep.com>
Re: Streaming replication and postmaster signaling Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>
Re: Streaming replication and postmaster signaling Robert Haas <robertmhaas@gmail.com>
Looking at the latest streaming replication patch, I don't much like the
signaling between WAL sender and postmaster. It seems complicated, and
as a rule of thumb postmaster shouldn't be accessing shared memory. The
current signaling is:

1. A new connection arrives. A new backend process is forked forked like
for a normal connection.
2. When the new process is done with the initialization, it allocates
itself a slot from WalSndCtlData shared memory array. It marks its pid
there, sets registered = false, and signals postmaster with
PMSIGNAL_REGISTER_WALSENDER
3. Upon receiving that signal, postmaster scans the WalSndCtlData array
looking for entries with registered==false. For such entries, it scans
the postmaster-private backend list for a matching entry with the same
pid, marks the entry in the list as a walsender, and sets
registered=true in the shared memory entry.

This way postmaster knows which child processes are walsenders, when
it's time to signal them.

I think it would be better to utilize the existing array of child
processes in pmsignal.c. Instead of having postmaster peek into
WalSndCtlData, let's add a new state to PMChildFlags,
PM_CHILD_WALSENDER, which is just like PM_CHILD_ACTIVE but tells
postmaster that the child is not a normal backend but a walsender.

I've done that in my git branch.

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com

В списке pgsql-hackers по дате отправления
От: Craig Ringer
Дата:
Сообщение: Re: libpq naming on Win64
От: Dave Page
Дата:
Сообщение: Re: libpq naming on Win64
FAQ