Re: pgsql: Removed unused variable, openLogOff. - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pgsql: Removed unused variable, openLogOff.
Date
Msg-id 20190307141116.GC26628@paquier.xyz
Whole thread Raw
In response to Re: pgsql: Removed unused variable, openLogOff.  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pgsql: Removed unused variable, openLogOff.
List pgsql-hackers
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

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: few more wait events to add to docs
Next
From: Sandro Mani
Date:
Subject: [Patch] Mingw: Fix import library extension, build actual staticlibraries