[HACKERS] issue about the streaming replication

Поиск
Список
Период
Сортировка
От Jinhua Luo
Тема [HACKERS] issue about the streaming replication
Дата
Msg-id CAAc9rOyKAyzipiq7ee1=VbcRy2fRqV_hRujLbC0mrBkL07=7wQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [HACKERS] issue about the streaming replication  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Hi,

I make a test to see how postgresql handle replication diverge problem:

a) setup two pg cluster A and B
b) run A as master, B as salve, using streaming replication
c) insert some data into table foobar on A, shutdown the network
between A and B at the meantime, which ends up some data would be
missing on B
d) A crashes
e) promote B as new master, insert some data into table foobar on B
f) now data on A and B diverge

When I restart A as new slave, it reports below error in log:
record with incorrect prev-link

And worse is, when I shutdown B and promotes A as master again, it
fails to startup:
LOG:  database system was shut down in recovery
FATAL:  invalid memory alloc request size 2281725952

what's this error and why?

I think this diverge scenario is common, because it's likely the
master would crash due to some hardware issue (e.g. power off) which
would cause some committed transaction has not yet synced to slave,
while the slave would be promoted to new master and accepts new
transactions, then how to recover the old master? Moreover, how to
recover the data on old master which is missing on new master?

Regards,
Jinhua Luo



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: [HACKERS] \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] issue about the streaming replication