Lists: | pgsql-hackers |
---|
From: | "Kolb, Harald (NSN - DE/Munich)" <harald(dot)kolb(at)nsn(dot)com> |
---|---|
To: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Review of Synchronous Replication patches |
Date: | 2010-08-03 17:50:32 |
Message-ID: | 0A24C3E434FAE8478BA72FEE30ACD27402C1A671@DEMUEXC005.nsn-intra.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi,
After setting up a real SR cluster based on V9 beta3 and Fuji's SR patch
synch_rep_0722.patch
and doing some simple update_and_check tests, it seems that active and
standby are not in sync.
Can this be a problem of the SR or the HSB feature ?
Or is "fsync" still not supported ?
Used configuration:
node1# cat postgresql.conf
...
max_wal_senders = 2
wal_level = 'hot_standby'
wal_keep_segments = 10
checkpoint_segments = 10
checkpoint_timeout = 3min
hot_standby = on
quorum = 1
wal_sender_delay = 1ms # walsender cycle time, 1-10000 milliseconds
node2# cat recovery.conf
standby_mode = 'true'
#replication_mode = 'recv'
replication_mode = 'fsync'
Test script is:
node1# cat check.sh
#set -x
RC=$(./bin/psql postgres -t -h node1 -p 5432 -c "drop table test ;")
RC=$(./bin/psql postgres -t -h node1 -p 5432 -c "create table test (i
integer,d integer);")
RC=$(./bin/psql postgres -t -h node1 -p 5432 -c "insert into test values
(1,1);")
retry=1
while (true)
do
RC=$(./bin/psql postgres -t -h node1 -p 5432 -c "update test set
d=$retry where i=1;")
DATA=$(./bin/psql postgres -t -h node2 -p 5432 -c "select d from test
where i=1;")
DIFF=$(( $retry - $DATA ))
echo $retry - $DATA - $DIFF
i=$(( retry++ ))
done
Output is:
1 - 1 - 0
2 - 1 - 1
3 - 2 - 1
4 - 3 - 1
5 - 4 - 1
6 - 5 - 1
7 - 6 - 1
8 - 8 - 0
9 - 9 - 0
...
Any ideas ?
From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | "Kolb, Harald (NSN - DE/Munich)" <harald(dot)kolb(at)nsn(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Review of Synchronous Replication patches |
Date: | 2010-08-04 13:00:19 |
Message-ID: | AANLkTinGBNcHq_A_xH6EW_fCqdeH3p9Dy8pX013nD1=A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Tue, Aug 3, 2010 at 1:50 PM, Kolb, Harald (NSN - DE/Munich)
<harald(dot)kolb(at)nsn(dot)com> wrote:
> Or is "fsync" still not supported ?
Wouldn't you need to have it set to "apply" to get the behavior you want here?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company
From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | "Kolb, Harald (NSN - DE/Munich)" <harald(dot)kolb(at)nsn(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Review of Synchronous Replication patches |
Date: | 2010-08-05 10:26:08 |
Message-ID: | AANLkTimCn9vASTNUqO+srwHrQMwPMdaM+7vEOEG9z_ST@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Wed, Aug 4, 2010 at 10:00 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Tue, Aug 3, 2010 at 1:50 PM, Kolb, Harald (NSN - DE/Munich)
> <harald(dot)kolb(at)nsn(dot)com> wrote:
>> Or is "fsync" still not supported ?
>
> Wouldn't you need to have it set to "apply" to get the behavior you want here?
Yes. In that case, replication_mode needs to be set to "replay" aka "apply".
Regards,
--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center