Add a missing comment for PGPROC.pgprocno

Started by Aleksander Alekseevover 3 years ago2 messageshackers
Jump to latest
#1Aleksander Alekseev
aleksander@timescale.com

Hi hackers,

I tried to understand some implementation details of ProcArray and
discovered that this is a bit challenging to do due to a missing
comment for PGPROC.pgprocno. E.g. it's hard to understand why
ProcArrayAdd() preserves procArray->pgprocnos[] sorted by (PGPROC *)
if actually the sorting is done by pgprocno. Took me some time to
figure this out.

Here is the patch that fixes this. Hopefully this will save some time
for the newcomers.

--
Best regards,
Aleksander Alekseev

Attachments:

v1-0001-Add-a-missing-comment-for-PGPROC.pgprocno.patchapplication/octet-stream; name=v1-0001-Add-a-missing-comment-for-PGPROC.pgprocno.patchDownload+5-2
#2Bruce Momjian
bruce@momjian.us
In reply to: Aleksander Alekseev (#1)
Re: Add a missing comment for PGPROC.pgprocno

On Thu, Sep 8, 2022 at 08:16:07PM +0300, Aleksander Alekseev wrote:

Hi hackers,

I tried to understand some implementation details of ProcArray and
discovered that this is a bit challenging to do due to a missing
comment for PGPROC.pgprocno. E.g. it's hard to understand why
ProcArrayAdd() preserves procArray->pgprocnos[] sorted by (PGPROC *)
if actually the sorting is done by pgprocno. Took me some time to
figure this out.

Here is the patch that fixes this. Hopefully this will save some time
for the newcomers.

Thanks, patch applied to master.

--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com

Indecision is a decision. Inaction is an action. Mark Batterson