Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c)
Date: 2023-08-25 01:18:48
Message-ID: ZOgBeNyoeN3jAo3j@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 24, 2023 at 05:33:15PM -0700, Peter Geoghegan wrote:
> I am in favor of fixing the problem. I don't quite recall what it was
> that made the discussion stall last time around.

I think that you mean this one:
https://www.postgresql.org/message-id/CAH2-WznCscXnWmnj=STC0aSa7QG+BRedDnZsP=Jo_R9GUZvUrg@mail.gmail.com

Still that looks entirely different to me. Here we have a problem
where the number of free blocks stored may cause an overflow in the
internal routine retrieving a free block, but your other thread
is about long being not enough on Windows. I surely agree that
there's an argument for improving this interface and remove its use of
long in the long-term but that would not be backpatched. I also don't
see why we cannot do the change proposed here until then, and it's
backpatchable.

There is a second thread related to logtape.c here, but that's still
different:
https://www.postgresql.org/message-id/flat/CAH2-Wzn5PCBLUrrds%3DhD439LtWP%2BPD7ekRTd%3D8LdtqJ%2BKO5D1Q%40mail.gmail.com
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-08-25 01:25:32 Re: Fix error handling in be_tls_open_server()
Previous Message Ian Lawrence Barwick 2023-08-25 00:36:18 Re: pg_stat_get_backend_subxact() and backend IDs?