Re: pg_test_timing: fix unit typo and widen diff type
Chao Li <li.evan.chao@gmail.com>
From: Chao Li <li.evan.chao@gmail.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: "wang.xiao.peng" <wxp_728@163.com>,
lukas@fittl.com,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Tom Lane <tgl@sss.pgh.pa.us>,
Hannu Krosing <hannuk@google.com>
Date: 2026-04-23T02:02:31Z
Lists: pgsql-hackers
Attachments
- nocfbot.v10-v13.pg_test_timing-backpatch.diff (application/octet-stream) patch v10
- nocfbot.v14-v15.pg_test_timing-backpatch.diff (application/octet-stream) patch v14
- nocfbot.v16-v18.pg_test_timing-backpatch.diff (application/octet-stream) patch v16
- v5-0001-pg_test_timing-fix-unit-in-backward-clock-warning.patch (application/octet-stream) patch v5-0001
- v5-0002-pg_test_timing-use-int64-for-largest-observed-tim.patch (application/octet-stream) patch v5-0002
> On Apr 23, 2026, at 00:11, Fujii Masao <masao.fujii@gmail.com> wrote: > > On Wed, Apr 22, 2026 at 5:58 PM Chao Li <li.evan.chao@gmail.com> wrote: >> PFA v4: >> >> * 0001 unchanged from v3. >> * 0002 changed size of histogram[] 64. > > Thanks for updating the patch! > > Since patch 0001 is a bug fix, it should be backpatched to the supported stable > branches. However, in v19 the unit should be changed like s/ms/ns, while in v18 > and earlier s/ms/us, since those older branches report the diff in microseconds. > Right? I just checked old branches. Looks like 0001 can be back-patched down to v10. Yes, pre-19, all branches use microsecond, so the back-patch should change “ms” to “us”. I have helped create back-patch diff files as attached: * nocfbot.v10-v13.pg_test_timing-backpatch.diff for v10-v13 * nocfbot.v14-v15.pg_test_timing-backpatch.diff for v14-v15 * nocfbot.v16-v18.pg_test_timing-backpatch.diff for v16-v18 For v16 to v18, we can make a tiny improvement by replacing “1e9” with a constant macro NS_PER_S. This change has been included in the diff. I have built and tested on all branches. > > Patch 0002 looks more like an improvement than a bug fix, so we should probably > wait for the next CommitFest before committing it. Thoughts? > I see 0002 a bit differently. In v19, the unit changed from microseconds to nanoseconds, which introduced a potential overflow: nanoseconds require int64, but the local variable remained int32. So I think this is actually a v19-only bug. PFA v5: 0001 replaced “1e9” with NS_PER_S; 0002 unchanged. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
pg_test_timing: store timing deltas in int64
- 863c4b827d92 19 (unreleased) landed
-
pg_test_timing: fix unit in backward-clock warning
- fb5acf2d8f2e 14.23 landed
- d7241c156d41 15.18 landed
- 07e96aeff93f 16.14 landed
- 1fdf1c63744c 17.10 landed
- a8dbe5288b0e 18.4 landed
- 019cc9962bdb 19 (unreleased) landed