Re: LISTEN/NOTIFY testing woes

From: Martijn van Oosterhout <kleptog(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Mark Dilger <hornschnorter(at)gmail(dot)com>
Subject: Re: LISTEN/NOTIFY testing woes
Date: 2019-11-24 13:19:39
Message-ID: CADWG95tY_SOorwzZ8JBvuELks9YHxy5NvU4cACwRfGZ-TSKTGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hoi Tom,

On Sun, 24 Nov 2019 at 02:01, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> This seems both undesirable for our own testing, and rather bogus
> from users' standpoints as well. However, I think a simple fix is
> available: just make the SQL pg_notification_queue_usage() function
> advance the queue tail before measuring, as in 0002 below. This will
> restore the behavior of that function to what it was before 51004c717,
> and it doesn't seem like it'd cost any performance in any plausible
> use-cases.

This was one of those open points in the previous patches where it
wasn't quite clear what the correct behaviour should be. This fixes
the issue, but the question in my mind is: do we want to document this
fact and can users rely on this behaviour? If we go with the argument
that the delay in cleaning up should be entirely invisible, then I
guess this patch is the correct one that makes the made changes
invisible. Arguably not doing this means we'd have to document the
values are possibly out of date.

So I think this patch does the right thing.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)gmail(dot)com> http://svana.org/kleptog/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2019-11-24 14:23:38 [PATCH] Possible arithmetic with NULL pointer or test "stack_base_ptr != NULL" is irrelevant.
Previous Message Ranier Vilela 2019-11-24 13:00:10 [PATCH] Fix var declaration according scanf specification,