pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: suppressing useless wakeups in logical/worker.c
Date: Thu, 26 Jan 2023 12:23:01 -0800
Message-ID: <20230126202301.GA1703463@nathanxps13> (raw)
In-Reply-To: <3165443.1674763470@sss.pgh.pa.us>
References: <2557815.1674603908@sss.pgh.pa.us>
	<20230125235004.GA1327755@nathanxps13>
	<CA+hUKGJ=oFEX=TjeSCnGmqr_KseGLJxy=RnJMwRqPrX7N-Q2sg@mail.gmail.com>
	<20230126003319.GA1507251@nathanxps13>
	<2878152.1674700077@sss.pgh.pa.us>
	<CA+hUKGLpH=y4=Zx+=oLE8WvLqLHWNC-PEDARrrt=x=J_REL9Fg@mail.gmail.com>
	<2888102.1674705840@sss.pgh.pa.us>
	<3126727.1674759248@sss.pgh.pa.us>
	<20230126194812.GA1702315@nathanxps13>
	<3165443.1674763470@sss.pgh.pa.us>

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





view thread (25+ messages)  latest in thread

Message-ID: <20230126202301.GA1703463@nathanxps13>
Permalink:  ../20230126202301.GA1703463@nathanxps13/
Also on:    postgresql.org/message-id/20230126202301.GA1703463@nathanxps13

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, tgl@sss.pgh.pa.us, thomas.munro@gmail.com, kuroda.hayato@fujitsu.com
  Subject: Re: suppressing useless wakeups in logical/worker.c
  In-Reply-To: <20230126202301.GA1703463@nathanxps13>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox