Re: BUG #17804: Assertion failed in pg_stat after fetching from pg_stat_database and switching cache->snapshot
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: michael@paquier.xyz
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2023-04-28T06:06:28Z
Lists: pgsql-bugs
At Fri, 28 Apr 2023 15:04:04 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in > At Fri, 28 Apr 2023 13:37:23 +0900, Michael Paquier <michael@paquier.xyz> wrote in > > FWIW, I was looking at this patch and this proposal of relying on a > > static flag to conditionally clear a snapshot looks rather brittle by > > design to me because this relies on quite a few assumptions that the > > snapshot will always be cleared when necessary, as proved by the two > > code paths of pgstat.c patched where each gain a check on > > pgstat_get_stat_snapshot_timestmp() necessarily requires that. Just Sorry, this is actually the opposite. pgstat_get_stat_snapshot_timestmp() doesn't necessarily requires that. Just > for seeming consistency. The only significant part is > gstat_prep_snapshot, which is always called when the caller wants a > snapshot. Regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Fix assertion failure when updating stats_fetch_consistency in a transaction
- ccd21e1cfa11 15.4 landed
- 605994651b6a 16.0 landed
-
Document values of stats_fetch_consistency in postgresql.conf.sample
- 4d47eff99cc0 16.0 landed