timeout value overflow in wait for lsn

From: cca5507 <cca5507(at)qq(dot)com>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: timeout value overflow in wait for lsn
Date: 2026-08-19 13:40:34
Message-ID: tencent_86B83240785807077600A1778566B5C12908@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

The valid range of the timeout value in wait for lsn command is int64, which can overflow
later in WaitForLSN():

```
postgres=# wait for lsn '99/99999999' with (mode 'primary_flush', timeout '10000000000000000ms');
ERROR: &nbsp;timed out while waiting for target LSN 99/99999999 to be flushed; current primary_flush LSN 0/017CA348
Time: 0.584 ms
```

To fix it, change the valid range to int32, just like deadlock_timeout and many other GUCs.

Thoughts?

--
Regards,
ChangAo Chen

Attachment Content-Type Size
v1-0001-Fix-timeout-value-overflow-in-wait-for-lsn.patch application/octet-stream 865 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-08-19 13:49:17 Re: SSI: ON CONFLICT DO SELECT takes no predicate lock on the returned row
Previous Message Andres Freund 2026-08-19 13:27:04 Re: aio: Don't silently drop wait_event_info