pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: David G. Johnston <david.g.johnston@gmail.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Nisha Moond <nisha.moond412@gmail.com>
Cc: Gunnar Morling <gunnar.morling@googlemail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Unexpected behavior when setting "idle_replication_slot_timeout"
Date: Sun, 6 Jul 2025 00:07:38 +0900
Message-ID: <3955f001-d66c-4899-a316-5f87f7ef9ecd@oss.nttdata.com> (raw )
In-Reply-To: <CAKFQuwbUEOww3_1h_aBnQDWdc1xz5egrP9iE_b_whb2cv3pLLQ@mail.gmail.com >
References: <CADGJaX_0+FTguWpNSpgVWYQP_7MhoO0D8=cp4XozSQgaZ40Odw@mail.gmail.com >
<CABdArM76e8-XChodqKxEiRK3tR_Yv3cymn_AWfP4bOsLDscZAg@mail.gmail.com >
<30e91649-06dd-453e-8658-5f4acd03a3bd@oss.nttdata.com >
<b26f13d7-769a-4b64-8bed-cb3a833c0604@oss.nttdata.com >
<686577f2379e4b978803e72746dcf0dd7baf3937.camel@cybertec.at >
<CAA4eK1Lp+ZY2Mr3jtspF_oKDUx7241h_Ke7g5g+D-XHFA7xC+g@mail.gmail.com >
<3422d282fd45e460b4ce1bd0745523ba63bd3848.camel@cybertec.at >
<CAKFQuwbUEOww3_1h_aBnQDWdc1xz5egrP9iE_b_whb2cv3pLLQ@mail.gmail.com >
On 2025/07/05 15:16, David G. Johnston wrote:
> On Fri, Jul 4, 2025 at 10:35 PM Laurenz Albe <laurenz.albe@cybertec.at <mailto:laurenz.albe@cybertec.at>> wrote:
>
> On the other hand, if the behavior is clearly documented, as I have
> tried to do with my patch, it should be fine. So I'll rest my case if
> you apply my patch.
>
>
> We should clearly document how rounding works in section 19.1.1 (which we mostly do; "If the parameter is of integer type, a final rounding to integer occurs after any unit conversion.") and not in every time-related setting that chooses to use something larger than microseconds. So, 30s is 'unit converted' up to 0.5 minutes (not explicitly explained...) then rounded to zero (which is odd, half normally rounds up...).
This happens because in this case rounding is done using rint(3),
which uses banker's rounding by default. While the rint(3)'s rounding method
can be changed with fesetround(), PostgreSQL doesn't seem to change it.
So 0.5 rounds to 0, 1.5 and 2.5 round to 2, 3.5 and 4.5 round to 4, and so on.
Regards,
--
Fujii Masao
NTT DATA Japan Corporation
view thread (38+ messages) latest in thread
Message-ID: <3955f001-d66c-4899-a316-5f87f7ef9ecd@oss.nttdata.com>
Permalink: ../3955f001-d66c-4899-a316-5f87f7ef9ecd@oss.nttdata.com/
Also on: postgresql.org/message-id/3955f001-d66c-4899-a316-5f87f7ef9ecd@oss.nttdata.com
copy link · copy postgr.es
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-bugs@postgresql.org
Cc: masao.fujii@oss.nttdata.com, david.g.johnston@gmail.com, laurenz.albe@cybertec.at, amit.kapila16@gmail.com, nisha.moond412@gmail.com, gunnar.morling@googlemail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: Unexpected behavior when setting "idle_replication_slot_timeout"
In-Reply-To: <3955f001-d66c-4899-a316-5f87f7ef9ecd@oss.nttdata.com>
* 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