pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Aleksander Alekseev <a.alekseev@postgrespro.ru>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Yet another small patch - reorderbuffer.c:1099
Date: Wed, 6 Apr 2016 13:07:33 +0300
Message-ID: <20160406130733.686c2764@fujitsu> (raw)
In-Reply-To: <CA+Tgmoa6OJWnezmyvVkrXO-B-OpYzT=GsoRKtXwjDQyoqDvEiw@mail.gmail.com>
References: <CANP8+jJWjt-RD8oA_ya=MXcs3OPmg4Qxt=JUy_1ovnBJ5Fi6=g@mail.gmail.com>
	<20160405143827.GA258373@alvherre.pgsql>
	<CA+Tgmoa6OJWnezmyvVkrXO-B-OpYzT=GsoRKtXwjDQyoqDvEiw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

> > IMO the code is wrong.  There should be a single block comment
> > saying something like "Remove the node from its containing list.
> > In the FOO case, the list corresponds to BAR and therefore we
> > delete it because BAZ.  In the QUUX case the list is PLUGH and we
> > delete in because THUD." Then a single line dlist_delete(...)
> > follows.
> >
> > The current arrangement looks bizantine to me, for no reason.  If we
> > think that one of the two branches might do something additional to
> > the list deletion, surely that will be in a separate stanza with
> > its own comment; and if we ever want to remove the list deletion
> > from one of the two cases (something that strikes me as unlikely)
> > then we will need to fix the comment, too.
> 
> +1 to everything here except for the way byzantine is spelled.
> 

+1 and yet another patch.

-- 
Best regards,
Aleksander Alekseev
http://eax.me/

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

Attachments:

reorderbuffer-v2.diff (text/x-patch, 1.0K) download diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index 52c6986..360e6fd 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -1159,17 +1159,17 @@ ReorderBufferCleanupTXN(ReorderBuffer *rb, ReorderBufferTXN *txn) txn->base_snapshot_lsn = InvalidXLogRecPtr; } - /* delete from list of known subxacts */ - if (txn->is_known_as_subxact) - { - /* NB: nsubxacts count of parent will be too high now */ - dlist_delete(&txn->node); - } - /* delete from LSN ordered list of toplevel TXNs */ - else - { - dlist_delete(&txn->node); - } + /* + * Remove TXN from its containing list. Note that following line covers + * two cases. + * + * If TXN is a subxact we delete it from list of known subxacts. NB: + * nsubxacts count of parent becomes too high in this case. + * + * Otherwise we delete TXN from ordered list of toplevel TXNs. + * + */ + dlist_delete(&txn->node); /* now remove reference from buffer */ hash_search(rb->by_txn,

view thread (11+ messages)  latest in thread

Message-ID: <20160406130733.686c2764@fujitsu>
Permalink:  ../20160406130733.686c2764@fujitsu/
Also on:    postgresql.org/message-id/20160406130733.686c2764@fujitsu

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: a.alekseev@postgrespro.ru, robertmhaas@gmail.com, alvherre@2ndquadrant.com, simon@2ndquadrant.com, andres@anarazel.de, michael.paquier@gmail.com
  Subject: Re: Yet another small patch - reorderbuffer.c:1099
  In-Reply-To: <20160406130733.686c2764@fujitsu>
  References: <CANP8+jJWjt-RD8oA_ya=MXcs3OPmg4Qxt=JUy_1ovnBJ5Fi6=g@mail.gmail.com> <20160405143827.GA258373@alvherre.pgsql> <CA+Tgmoa6OJWnezmyvVkrXO-B-OpYzT=GsoRKtXwjDQyoqDvEiw@mail.gmail.com> <20160406130733.686c2764@fujitsu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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