Re: Diagnostic comment in LogicalIncreaseXminForSlot

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Diagnostic comment in LogicalIncreaseXminForSlot
Date: 2021-07-13 04:30:49
Message-ID: CAGEoWWTq021OZubCjG9m8zLJYEC5sKgzQtbr0fESo0Lh_9bN4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 12, 2021 at 6:23 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:

> On Mon, Jul 12, 2021 at 5:28 PM Ashutosh Bapat
> <ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
> >
> > On Mon, Jul 12, 2021 at 8:39 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> wrote:
> >>
> >> I have noticed that
> >> a nearby function LogicalIncreaseRestartDecodingForSlot() logs similar
> >> information after releasing spinlock, so it is better to follow the
> >> same here as well.
> >
> >
> > Now that you mention it, the code their looks rather suspicious :)
> > We acquire the spinlock at the beginning of the function but do not
> release it if (restart_lsn <= slot->data.restart_lsn) or if (current_lsn <=
> slot->data.confirmed_flush).
> >
>
> Note that we end else if with (current_lsn <=
> slot->data.confirmed_flush) and after that there is a new if. We
> release lock in both the if/else conditions, so the code is fine as it
> is.
>

Ah! I overlooked the closing else if (). Sorry for the noise.

--
Best Wishes,
Ashutosh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo NAGATA 2021-07-13 04:32:24 Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors
Previous Message Tom Lane 2021-07-13 04:25:06 Re: Bogus HAVE_DECL_FOO entries in msvc/Solution.pm