minor fix in CancelVirtualTransaction

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: minor fix in CancelVirtualTransaction
Date: 2018-06-29 17:05:12
Message-ID: 20180629170512.d6kof6l6uu3qqpd6@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

It looks to me like we're missing a trick in CancelVirtualTransaction --
there's a loop to compare all VXIDs, and we break as soon as find a
perfect match in (backendid, localTransactionId). However, once we've
found the backendId that matches, it's not possible for there to be
another entry with the same backendId, so we might as well just quit the
loop, even if we don't send a signal.

No, I don't know if this shows in profiles. I just noticed while
reading code.

Attached patch (git diff --ignore-space-change; needs reindent)
illustrates. This was added by commit efc16ea52067 (Dec 2009) and seems
unchanged since then.

Álvaro Herrera Developer, https://www.PostgreSQL.org/

Attachment Content-Type Size
0001-fixup-CancelVirtualTransaction.patch text/plain 1.0 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-06-29 17:19:17 Re: Failed assertion due to procedure created with SECURITY DEFINER option
Previous Message Alvaro Herrera 2018-06-29 16:57:56 Re: pgsql: Fix "base" snapshot handling in logical decoding