Re: Add progressive backoff to XactLockTableWait functions

Поиск
Список
Период
Сортировка
От Xuneng Zhou
Тема Re: Add progressive backoff to XactLockTableWait functions
Дата
Msg-id CABPTF7V609C94d3hUBXtE78KsmJPsMrSOQ3Bui3w3P+NMOF2aQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add progressive backoff to XactLockTableWait functions  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Список pgsql-hackers
Hi,

Thanks for the feedback! 

On Thu, Jun 12, 2025 at 10:02 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote:


When I first suggested this idea, I used 10s as an example for
the maximum sleep time. But thinking more about it now, 10s might
be too long. Even if the target transaction has already finished,
XactLockTableWait() could still wait up to 10 seconds,
which seems excessive.

+1, this could be a problem 
 
What about using 1s instead? That value is already used as a max
sleep time in other places, like WaitExceedsMaxStandbyDelay().

1s should be generally good
 
If we agree on 1s as the max, then using exponential backoff from
1ms to 1s after the threshold might not be necessary. It might
be simpler and sufficient to just sleep for 1s once we hit
the threshold.

That makes sense to me.

Based on that, I think a change like the following could work well.
Thought?

I'll update the patch accordingly.

Best regards,
Xuneng

В списке pgsql-hackers по дате отправления: