On Thu, Oct 13, 2022 at 03:35:14PM +0530, Bharath Rupireddy wrote: > I think the hot standby feedback message gets sent too frequently > without honouring the wal_receiver_status_interval because the 'now' > is actually not the current time with your patch but 'now + > XLogWalRcvSendReply()'s time'. However, it's possible that I may be > wrong here.
Is your concern that the next wakeup time will be miscalculated because of a stale value in 'now'? I think that's existing behavior, as we save the current time before sending the message in XLogWalRcvSendReply and XLogWalRcvSendHSFeedback. The only way to completely avoid this would be to call GetCurrentTimestamp() after the message has been sent and to use that value to calculate when the next message should be sent. However, I am skeptical there's really any practical impact. Is it really a problem if a message that should be sent every 30 seconds is sent at an interval of 29.9 seconds sometimes? I think it could go the other way, too. If 'now' is stale, we might decide not to send a feedback message until the next loop iteration, so the interval might be 30.1 seconds. I don't think it's realistic to expect complete accuracy here. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com