pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14803: use receiverPtr as the endptr to call KeepLogSeg(endptr, &_logSegNo) in CreateRestartPoint
2+ messages / 2 participants
[nested] [flat]

* BUG #14803: use receiverPtr as the endptr to call KeepLogSeg(endptr, &_logSegNo) in CreateRestartPoint
@ 2017-09-07 05:10  bret.shao@outlook.com
  0 siblings, 1 reply; 2+ messages in thread

From: bret.shao@outlook.com @ 2017-09-07 05:10 UTC (permalink / raw)
  To: pgsql-bugs; +Cc: bret.shao@outlook.com

The following bug has been logged on the website:

Bug reference:      14803
Logged by:          bret shao
Email address:      bret.shao@outlook.com
PostgreSQL version: 9.5.7
Operating system:   ubantu
Description:        

when call KeepLogSeg to get the oldest xlog file in function
CreateRestartPoint,
I think the endptr shoule be the repalyPtr not the later one of receiverPtr
and replayPtr.
 endptr = (receivePtr < replayPtr) ? replayPtr : receivePtr;

Because that if the endptr is the receiverPtr, it means that may be the xlog
file that is being redo will be dropped.

if the file which is being needed in recover redo work is dropped then the
server will down.

i'm not very clear why use receiverPtr as the endptr to call
KeepLogSeg(endptr, &_logSegNo);




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


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #14803: use receiverPtr as the endptr to call KeepLogSeg(endptr, &_logSegNo) in CreateRestartPoint
@ 2017-09-08 07:32  Michael Paquier <michael.paquier@gmail.com>
  parent: bret.shao@outlook.com
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2017-09-08 07:32 UTC (permalink / raw)
  To: bret.shao@outlook.com; +Cc: pgsql-bugs

On Thu, Sep 7, 2017 at 2:10 PM,  <bret.shao@outlook.com> wrote:
> when call KeepLogSeg to get the oldest xlog file in function
> CreateRestartPoint,
> I think the endptr shoule be the repalyPtr not the later one of receiverPtr
> and replayPtr.
>  endptr = (receivePtr < replayPtr) ? replayPtr : receivePtr;
>
> Because that if the endptr is the receiverPtr, it means that may be the xlog
> file that is being redo will be dropped.

There are timeline-related things to consider, in short when doing a
timeline jump you may finish with a segment that you did not expect to
be recycled. See the link to the discussion and the commit in
question:
https://www.postgresql.org/message-id/50D30851.2030509%40vmware.com
http://git.postgresql.org/pg/commitdiff/af275a12dfeecd621ed9899a9382f26a68310263
-- 
Michael


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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-09-08 07:32 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-09-07 05:10 BUG #14803: use receiverPtr as the endptr to call KeepLogSeg(endptr, &_logSegNo) in CreateRestartPoint bret.shao@outlook.com
2017-09-08 07:32 ` Michael Paquier <michael.paquier@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox