Correct comment in RemoveNonParentXlogFiles()

From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Correct comment in RemoveNonParentXlogFiles()
Date: 2022-08-03 12:46:33
Message-ID: CAE9k0PnOWt7Q_x_1Aq_081+p=ujQGshpJDTMi22vxrZoEJ6wxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

HI All,

Following comment in RemoveNonParentXlogFiles() says that we are trying to
remove any WAL file whose segment number is >= the segment number of the
first WAL file on the new timeline. However, looking at the code, I can say
that we are trying to remove the WAL files from the previous timeline whose
segment number is just greater than (not equal to) the segment number of
the first WAL file in the new timeline. I think we should improve this
comment, thoughts?

/*
* Remove files that are on a timeline older than the new one we're
* switching to, but with a segment number >= the first segment on
the
* new timeline.
*/
if (strncmp(xlde->d_name, switchseg, 8) < 0 &&
strcmp(xlde->d_name + 8, switchseg + 8) > 0)

--
With Regards,
Ashutosh Sharma.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-08-03 13:27:21 Re: logical replication restrictions
Previous Message Dilip Kumar 2022-08-03 11:55:42 Re: Smoothing the subtrans performance catastrophe