Re: suppressing useless wakeups in logical/worker.c

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: suppressing useless wakeups in logical/worker.c
Дата
Msg-id 20230126202301.GA1703463@nathanxps13
обсуждение исходный текст
Ответ на Re: suppressing useless wakeups in logical/worker.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: suppressing useless wakeups in logical/worker.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Jan 26, 2023 at 03:04:30PM -0500, Tom Lane wrote:
> Nathan Bossart <nathandbossart@gmail.com> writes:
>> I wonder if we should explicitly reject negative timestamps to eliminate
>> any chance of int64 overflow, too.
> 
> Hmm.  I'm disinclined to add an assumption that the epoch is in the past,
> but I take your point that the subtraction would overflow with
> TIMESTAMP_INFINITY and a negative finite timestamp.  Maybe we should
> make use of pg_sub_s64_overflow()?

That would be my vote.  I think the 'diff <= 0' check might need to be
replaced with something like 'start_time > stop_time' so that we return 0
for the underflow case.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: Re: Something is wrong with wal_compression
Следующее
От: Reid Thompson
Дата:
Сообщение: Re: Add the ability to limit the amount of memory that can be allocated to backends.