Thread: Re: pgsql: Removed unused variable, openLogOff.

Re: pgsql: Removed unused variable, openLogOff.

From
Michael Paquier
Date:
On Wed, Mar 06, 2019 at 02:47:16PM +0000, Robert Haas wrote:
> Removed unused variable, openLogOff.

Is that right for the report if data is written in chunks?  The same
patch has been proposed a couple of weeks ago, and I commented about
it as follows:
https://www.postgresql.org/message-id/20190129043439.GB3121@paquier.xyz
--
Michael

Attachment

Re: pgsql: Removed unused variable, openLogOff.

From
Robert Haas
Date:
On Wed, Mar 6, 2019 at 6:53 PM Michael Paquier <michael@paquier.xyz> wrote:
> On Wed, Mar 06, 2019 at 02:47:16PM +0000, Robert Haas wrote:
> > Removed unused variable, openLogOff.
>
> Is that right for the report if data is written in chunks?  The same
> patch has been proposed a couple of weeks ago, and I commented about
> it as follows:
> https://www.postgresql.org/message-id/20190129043439.GB3121@paquier.xyz

Oh, sorry, I didn't see the earlier thread.  You're right that this is
messed up: if we're going to report startOffset rather than
openLogOff, we need to report nleft rather than bytes.  I would prefer
to change nbytes -> nleft rather than anything else, though, because
it seems to me that we should report the offset and length that
actually failed, not the start of the whole chunk which partially
succeeded.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgsql: Removed unused variable, openLogOff.

From
Michael Paquier
Date:
On Thu, Mar 07, 2019 at 08:03:19AM -0500, Robert Haas wrote:
> Oh, sorry, I didn't see the earlier thread.  You're right that this is
> messed up: if we're going to report startOffset rather than
> openLogOff, we need to report nleft rather than bytes.  I would prefer
> to change nbytes -> nleft rather than anything else, though, because
> it seems to me that we should report the offset and length that
> actually failed, not the start of the whole chunk which partially
> succeeded.

I found the original coding cleaner logically (perhaps a matter of
personal taste and I am quite used to it so I am under influence!) by
reporting at which position it has failed when writing a given chunk.
Now it is the second time that somebody is sending a patch for that in
a couple of weeks, so visibly people obviously would like to simplify
this code :)

If you want to keep this formulation, that's fine for me.  However you
should really change it to nleft as you suggest, and not keep nbytes.
--
Michael

Attachment

Re: pgsql: Removed unused variable, openLogOff.

From
Michael Paquier
Date:
On Thu, Mar 07, 2019 at 11:11:16PM +0900, Michael Paquier wrote:
> If you want to keep this formulation, that's fine for me.  However you
> should really change it to nleft as you suggest, and not keep nbytes.

After sleeping on it, let's live with just switching to nleft in the
message, without openLogOff as that's the second time folks complain
about the previous code.  So I just propose the attached.  Robert,
others, any objections?  Perhaps you would prefer fixing it yourself?
--
Michael

Attachment

Re: pgsql: Removed unused variable, openLogOff.

From
Michael Paquier
Date:
On Fri, Mar 08, 2019 at 10:27:52AM +0900, Michael Paquier wrote:
> After sleeping on it, let's live with just switching to nleft in the
> message, without openLogOff as that's the second time folks complain
> about the previous code.  So I just propose the attached.  Robert,
> others, any objections?  Perhaps you would prefer fixing it yourself?

Okay, done.
--
Michael

Attachment

Re: pgsql: Removed unused variable, openLogOff.

From
Robert Haas
Date:
On Thu, Mar 7, 2019 at 8:27 PM Michael Paquier <michael@paquier.xyz> wrote:
> After sleeping on it, let's live with just switching to nleft in the
> message, without openLogOff as that's the second time folks complain
> about the previous code.  So I just propose the attached.  Robert,
> others, any objections?  Perhaps you would prefer fixing it yourself?

Sorry that I didn't get to this before you did -- I was on PTO on
Friday and did not work on the weekend.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pgsql: Removed unused variable, openLogOff.

From
Michael Paquier
Date:
On Mon, Mar 11, 2019 at 03:30:22PM -0400, Robert Haas wrote:
> Sorry that I didn't get to this before you did -- I was on PTO on
> Friday and did not work on the weekend.

My apologies, Robert.  It seems that I have been too much hasty
then.  There are so many things going around lately, it is hard to
keep track of everything...
--
Michael

Attachment

Re: pgsql: Removed unused variable, openLogOff.

From
Robert Haas
Date:
On Mon, Mar 11, 2019 at 10:23 PM Michael Paquier <michael@paquier.xyz> wrote:
> On Mon, Mar 11, 2019 at 03:30:22PM -0400, Robert Haas wrote:
> > Sorry that I didn't get to this before you did -- I was on PTO on
> > Friday and did not work on the weekend.
>
> My apologies, Robert.  It seems that I have been too much hasty
> then.  There are so many things going around lately, it is hard to
> keep track of everything...

No, it's fine.  I just wanted to explain why I didn't take care of it.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company