Re: Throttling WAL inserts when the standby falls behind more than the configured replica_lag_in_bytes - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Throttling WAL inserts when the standby falls behind more than the configured replica_lag_in_bytes
Date
Msg-id CAOBaU_YWhw4pjvDR7qwE9b3C0wgT9EiVXEGBTzO3zEoe+MS5Lg@mail.gmail.com
Whole thread Raw
In response to Re: Throttling WAL inserts when the standby falls behind more than the configured replica_lag_in_bytes  (SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>)
List pgsql-hackers
On Sun, Dec 26, 2021 at 1:06 PM SATYANARAYANA NARLAPURAM
<satyanarlapuram@gmail.com> wrote:
>
> Got it, understood the concern. But can we document the limitations of the hook and let the hook take care of it? I
don'texpect an error to be thrown here since we are not planning to allocate memory or make file system calls but
insteadlook at the shared memory state and add delays when required. 

It wouldn't work.  You can't make any assumption about how long it
would take for the replication lag to resolve, so you may have to wait
for a very long time.  It means that at the very least the sleep has
to be interruptible and therefore can raise an error.  In general
there isn't much you can due in a critical section, so this approach
doesn't seem sensible to me.



pgsql-hackers by date:

Previous
From: SATYANARAYANA NARLAPURAM
Date:
Subject: Re: Throttling WAL inserts when the standby falls behind more than the configured replica_lag_in_bytes
Next
From: Dilip Kumar
Date:
Subject: Re: Throttling WAL inserts when the standby falls behind more than the configured replica_lag_in_bytes