Re: Add progressive backoff to XactLockTableWait functions

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Kevin K Biju <kevinkbiju(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add progressive backoff to XactLockTableWait functions
Date: 2025-06-15 08:01:12
Message-ID: CABPTF7XaWLJT5u1mBs15Sxf5UV_qJqh4=NtSN-9nKXfhqn4JwA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Attached is v2 of the patch to add threshold-based sleep to
XactLockTableWait functions.

Changes from v1:
- Simplified approach based on Fujii's feedback [1]: instead of exponential
backoff,
we now sleep 1ms for the first 5 seconds, then switch directly to 1s
sleeps
- Reduced the threshold from 10 seconds to 5 seconds to avoid excessive
delays

[1]
https://www.postgresql.org/message-id/7c72c5d1-4d2f-46f7-8b68-dd96905f8c42%40oss.nttdata.com

Best regards,
Xuneng

Attachment Content-Type Size
v2-0001-Add-threshold-based-sleep-to-XactLockTableWait-functions.patch application/octet-stream 3.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2025-06-15 09:00:01 Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly
Previous Message D Laaren 2025-06-15 05:11:24 Timeline switching with partial WAL records can break replica recovery