pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Euler Taveira <euler@eulerto.com>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Kartyshov Ivan <i.kartyshov@postgrespro.ru>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed
Date: Fri, 29 Mar 2024 13:50:33 -0300
Message-ID: <8aec133e-5d7f-4fa1-8223-257647dd1ccd@app.fastmail.com> (raw)
In-Reply-To: <CAPpHfduGLJgQERBmQ+=bsr4Oy6F8HCVgQpCYva6=Ncib2X2oUA@mail.gmail.com>
References: <CAPpHfdtiGgn0iS1KbW2HTam-1+oK+vhXZDAcnX9hKaA7Oe=F-A@mail.gmail.com>
	<22f122-655b3e80-3-688b3700@97587957>
	<CAPpHfdt=Edtk9B3owg4of6v5Y=vi6=5R9ZHM84KPOdR6mER0wg@mail.gmail.com>
	<b515af28c21b11305d71062f1590a2aa@postgrespro.ru>
	<4953563546cb8c8851f84c7debf723ef@postgrespro.ru>
	<31547e4e8c263392a768ea89a3f57833@postgrespro.ru>
	<CAA4eK1KBqcH74uJ-PP7J=ghEdvigazWoWgct-af+LLwnbT8SXQ@mail.gmail.com>
	<CAPpHfdsZ8hJiYaRxTbnKqVee_Nmbb+PVd+QtWifoBYkX71f0dA@mail.gmail.com>
	<CAPpHfduV3=v=0TmR-95To=7ZRQMimM5uqB1rtW520fcz-J5Dew@mail.gmail.com>
	<CAA4eK1+FsVRV5bH9838XzSRdiB9eKUFcPpGCknhZ9tHePWbuNw@mail.gmail.com>
	<CALj2ACUfS7LH1PaWmSZ5KwH4BpQxO9izeMw4qC3a1DAwi6nfbQ@mail.gmail.com>
	<CAPpHfdu+HAF=XPX2v+Qq+faV2bVhj=qLz1TbtAZX5shg8Zviow@mail.gmail.com>
	<a7601ec6-01d8-4561-b81d-a6605e9b4d55@eisentraut.org>
	<CALj2ACV5+A2fRkMdB1YLH8tHMy8xsUr1HMu5RffJpmnfH-_42A@mail.gmail.com>
	<5358d911a08ef2952b1e9f74062426ee@postgrespro.ru>
	<CAPpHfdsQNqQoFN_OosMUkZWLE-s=or=t+XVEHF5AGuMbdBMpew@mail.gmail.com>
	<CAPpHfdvZXSiVCqFNMzpk7Zhxk4hB6T55b+79J1nKLotNFL25Qw@mail.gmail.com>
	<CA+hUKGKXXP8ZgTfFfjhv77ALC-ZKcejR4pdfrfgVqYrG_75zeQ@mail.gmail.com>
	<CAPpHfdv1aXn-oUQNODQ0B6W7JC=t_S1b64V5DAx-HP+KOV-6Lg@mail.gmail.com>
	<88449be3-93e8-4d78-a0d8-c37e4cf26850@app.fastmail.com>
	<CAPpHfduGLJgQERBmQ+=bsr4Oy6F8HCVgQpCYva6=Ncib2X2oUA@mail.gmail.com>

On Fri, Mar 29, 2024, at 9:44 AM, Alexander Korotkov wrote:
> This generally makes sense, but I'm not sure about this.  The
> milliseconds timeout was used initially but received critics in [1].

Alexander, I see why you changed the patch.

Peter suggested to use an interval but you proposed another data type:
float. The advantage of the interval data type is that you don't need to
carefully think about the unit, however, if you use the integer data
type you have to propose one. (If that's the case, milliseconds is a
good granularity for this feature.) I don't have a strong preference
between integer and interval data types but I don't like the float for
this case. The 2 main reasons are (a) that we treat time units (hours,
minutes, seconds, ...) as integers so it seems natural for a human being
to use a unit time as integer and (b) depending on the number of digits
after the decimal separator you still don't have an integer in the
internal unit, hence, you have to round it to integer.

We already have functions that use integer (such as pg_terminate_backend)
and interval (such as pg_sleep_for) and if i searched correctly it will
be the first timeout argument as float.


--
Euler Taveira
EDB   https://www.enterprisedb.com/

view thread (216+ messages)  latest in thread

Message-ID: <8aec133e-5d7f-4fa1-8223-257647dd1ccd@app.fastmail.com>
Permalink:  ../8aec133e-5d7f-4fa1-8223-257647dd1ccd@app.fastmail.com/
Also on:    postgresql.org/message-id/8aec133e-5d7f-4fa1-8223-257647dd1ccd@app.fastmail.com

 · 

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: euler@eulerto.com, aekorotkov@gmail.com, thomas.munro@gmail.com, i.kartyshov@postgrespro.ru, bharath.rupireddyforpostgres@gmail.com, peter@eisentraut.org, amit.kapila16@gmail.com, dilipbalaut@gmail.com, smithpb2250@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed
  In-Reply-To: <8aec133e-5d7f-4fa1-8223-257647dd1ccd@app.fastmail.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