Обсуждение: Review of Synchronous Replication patches

Поиск
Список
Период
Сортировка

Review of Synchronous Replication patches

От
"Kolb, Harald (NSN - DE/Munich)"
Дата:
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 ?


Re: Review of Synchronous Replication patches

От
Robert Haas
Дата:
On Tue, Aug 3, 2010 at 1:50 PM, Kolb, Harald (NSN - DE/Munich)
<harald.kolb@nsn.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


Re: Review of Synchronous Replication patches

От
Fujii Masao
Дата:
On Wed, Aug 4, 2010 at 10:00 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Tue, Aug 3, 2010 at 1:50 PM, Kolb, Harald (NSN - DE/Munich)
> <harald.kolb@nsn.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