async replication code

Started by otheus uibkalmost 10 years ago4 messages
#1otheus uibk
otheus.uibk@gmail.com

Greetings,

I am new here. Apologetic question: how can i search the archives of this
mailing list? Is there some set of magic words to put in Google? Must I
wade through 20 pages of hits? Should I download all the archives and grep?
:)

Main question: I want to understand very precisely the exact algirithm
used in PG to do asynchronous streaming replication. Eg, I want to know how
the record is written and flushed to the socket and how that happens in
time w.r.t WAL-to-disk and response to client. Will someone please give me
a head start as to where to begin my code-spelunking?

--
Otheus
otheus.uibk@gmail.com
otheus.shelling@uibk.ac.at

#2Stas Kelvich
s.kelvich@postgrespro.ru
In reply to: otheus uibk (#1)
Re: async replication code

On 16 Mar 2016, at 15:52, otheus uibk <otheus.uibk@gmail.com> wrote:

Greetings,

Hi

I am new here. Apologetic question: how can i search the archives of this mailing list? Is there some set of magic words to put in Google? Must I wade through 20 pages of hits? Should I download all the archives and grep? :)

http://www.postgresql.org/list/

https://wiki.postgresql.org/wiki/Mailing_Lists

Main question: I want to understand very precisely the exact algirithm used in PG to do asynchronous streaming replication. Eg, I want to know how the record is written and flushed to the socket and how that happens in time w.r.t WAL-to-disk and response to client. Will someone please give me a head start as to where to begin my code-spelunking?

WAL synced to disc, then everything else is happening.

http://www.postgresql.org/docs/9.5/static/warm-standby.html#STREAMING-REPLICATION

---
Stas Kelvich
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3otheus uibk
otheus.uibk@gmail.com
In reply to: Stas Kelvich (#2)
Re: async replication code

I will ask again: where in the code is the asynchronous replication code?
The docs are not detailed/exact enough.

Main question: I want to understand very precisely the exact algirithm

used in PG to do asynchronous streaming replication. Eg, I want to know how
the record is written and flushed to the socket and how that happens in
time w.r.t WAL-to-disk and response to client. Will someone please give me
a head start as to where to begin my code-spelunking?

WAL synced to disc, then everything else is happening.

http://www.postgresql.org/docs/9.5/static/warm-standby.html#STREAMING-REPLICATION

---
Stas Kelvich
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

--
Otheus
otheus.uibk@gmail.com
otheus.shelling@uibk.ac.at

#4otheus uibk
otheus.uibk@gmail.com
In reply to: otheus uibk (#3)
Re: async replication code

On Wed, Mar 16, 2016 at 8:30 PM, otheus uibk <otheus.uibk@gmail.com> wrote:

I will ask again: where in the code is the asynchronous replication code?
The docs are not detailed/exact enough.

Nevermind. Thomas Munro answered my question in the General list. Quoting:

Look for WalSndWakeupRequest() in xlog.c, which expands to a call to
WalSndWakeup in walsender.c which sets latches (= a mechanism for
waking processes) on all walsenders, and see the WaitLatchOrSocket
calls in walsender.c which wait for that to happen.

--
Otheus
otheus.uibk@gmail.com
otheus.shelling@uibk.ac.at