Skip site navigation (1) Skip section navigation (2)

replay_location indicates incorrect location

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: replay_location indicates incorrect location
Date: 2012-01-13 10:04:49
Message-ID: CAHGQGwEs_CjXePip4fAODHPzDuRa1zCEm99Wu7_TG4R956k3TA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

When I looked at pg_stat_replication just after starting the standby before
executing any write transactions on the master, I found that replay_location
indicated incorrect location different from sent/write/flush_location. Then,
if I ran write transaction on the master, replay_location indicated the same
location as the others.

The cause of this problem is that Xlogctl->recoveryLastRecPtr which points
to replay_location is initialized with wrong variable ReadRecPtr. Instead, it
should be initialized with EndRecPtr. Attached patch does that. This needs
to be backported to 9.0.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment: incorrect_replay_location_v1.patch
Description: text/x-diff (650 bytes)

Responses

pgsql-hackers by date

Next:From: Alexander BjörnhagenDate: 2012-01-13 10:30:40
Subject: Re: Standalone synchronous master
Previous:From: Pierre CDate: 2012-01-13 09:48:56
Subject: Re: Inlining comparators as a performance optimisation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group