pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Removed unused variable, openLogOff.
9+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2019-03-11 f2d84a4a6b  Adjust error message for partial writes in WAL segments
* pgsql: Removed unused variable, openLogOff.
@ 2019-03-06 14:47  Robert Haas <rhaas@postgresql.org>
  0 siblings, 1 reply; 9+ messages in thread

From: Robert Haas @ 2019-03-06 14:47 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Removed unused variable, openLogOff.

Antonin Houska

Discussion: http://postgr.es/m/30413.1551870730@localhost

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/93473c6ac805994a74e74ed13828c6c9433c8faf

Modified Files
--------------
src/backend/access/transam/xlog.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)



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

* Re: pgsql: Removed unused variable, openLogOff.
@ 2019-03-06 23:52  Michael Paquier <michael@paquier.xyz>
  parent: Robert Haas <rhaas@postgresql.org>
  0 siblings, 1 reply; 9+ messages in thread

From: Michael Paquier @ 2019-03-06 23:52 UTC (permalink / raw)
  To: Robert Haas <rhaas@postgresql.org>; +Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

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

* Re: pgsql: Removed unused variable, openLogOff.
@ 2019-03-07 13:03  Robert Haas <robertmhaas@gmail.com>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 9+ messages in thread

From: Robert Haas @ 2019-03-07 13:03 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>

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




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

* Re: pgsql: Removed unused variable, openLogOff.
@ 2019-03-07 14:11  Michael Paquier <michael@paquier.xyz>
  parent: Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Michael Paquier @ 2019-03-07 14:11 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

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

* Re: pgsql: Removed unused variable, openLogOff.
@ 2019-03-08 01:27  Michael Paquier <michael@paquier.xyz>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 2 replies; 9+ messages in thread

From: Michael Paquier @ 2019-03-08 01:27 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>

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

Attachments:

xlog-nbytes-fix.patch (text/x-diff, 534B) download diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 0fdd82a287..9ab0efb0bb 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -2504,7 +2504,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible) errmsg("could not write to log file %s " "at offset %u, length %zu: %m", XLogFileNameP(ThisTimeLineID, openLogSegNo), - startoffset, nbytes))); + startoffset, nleft))); } nleft -= written; from += written;
signature.asc (application/pgp-signature, 832B) download ^ permalink raw reply [nested|flat] 9+ messages in thread

* Re: pgsql: Removed unused variable, openLogOff.
@ 2019-03-11 00:40  Michael Paquier <michael@paquier.xyz>
  parent: Michael Paquier <michael@paquier.xyz>
  1 sibling, 0 replies; 9+ messages in thread

From: Michael Paquier @ 2019-03-11 00:40 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

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

* Re: pgsql: Removed unused variable, openLogOff.
@ 2019-03-11 19:30  Robert Haas <robertmhaas@gmail.com>
  parent: Michael Paquier <michael@paquier.xyz>
  1 sibling, 1 reply; 9+ messages in thread

From: Robert Haas @ 2019-03-11 19:30 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>

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




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

* Re: pgsql: Removed unused variable, openLogOff.
@ 2019-03-12 02:23  Michael Paquier <michael@paquier.xyz>
  parent: Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Michael Paquier @ 2019-03-12 02:23 UTC (permalink / raw)
  To: Robert Haas <robertmhaas@gmail.com>; +Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

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

* Re: pgsql: Removed unused variable, openLogOff.
@ 2019-03-12 14:29  Robert Haas <robertmhaas@gmail.com>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 9+ messages in thread

From: Robert Haas @ 2019-03-12 14:29 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; +Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>

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




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


end of thread, other threads:[~2019-03-12 14:29 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 14:47 pgsql: Removed unused variable, openLogOff. Robert Haas <rhaas@postgresql.org>
2019-03-06 23:52 ` Michael Paquier <michael@paquier.xyz>
2019-03-07 13:03   ` Robert Haas <robertmhaas@gmail.com>
2019-03-07 14:11     ` Michael Paquier <michael@paquier.xyz>
2019-03-08 01:27       ` Michael Paquier <michael@paquier.xyz>
2019-03-11 00:40         ` Michael Paquier <michael@paquier.xyz>
2019-03-11 19:30         ` Robert Haas <robertmhaas@gmail.com>
2019-03-12 02:23           ` Michael Paquier <michael@paquier.xyz>
2019-03-12 14:29             ` Robert Haas <robertmhaas@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