On 2011-03-04 12:24, Yeb Havinga wrote:
I'm currently thinking about a failure test that would check if a commit has really waited for the standby. What's the worst thing to do to a master server? Ideas are welcome :-)

#!/bin/sh
psql -c "create a big table with generate_series"
echo 1 > /proc/sys/kernel/sysrq ; echo b > /proc/sysrq-trigger
Did that with both a sync and async standby server, then promoted both replicas.

Both replicas had the complete big table. Maybe the async server was somehow 'saved' by the master waiting for the sync server? Test repeated with only the async one connected.

The master then shows this at restart
LOG:  00000: record with zero length at 4/B2CD3598
LOG:  00000: redo done at 4/B2CD3558
LOG: 00000: last completed transaction was at log time 2011-03-04 14:43:31.02041+01

The async promoted server
LOG:  00000: record with zero length at 4/B2CC9260
LOG:  00000: redo done at 4/B2CC9220
LOG: 00000: last completed transaction was at log time 2011-03-04 14:43:31.018444+01

Even though the async server had the complete relation I created, something was apparently done just before the reboot.

Test repeated with only 1 sync standby

Then on master at recovery
LOG:  00000: record with zero length at 4/D1051C88
LOG:  00000: redo done at 4/D1051C48
LOG: 00000: last completed transaction was at log time 2011-03-04 14:52:11.035188+01

on the sync promoted server
LOG:  00000: redo done at 4/D1051C48
LOG: 00000: last completed transaction was at log time 2011-03-04 14:52:11.035188+01

Nice!

regards,
Yeb Havinga


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

Reply via email to