agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Revert online data checksum transitions
19+ messages / 9 participants
[nested] [flat]

* pgsql: Revert online data checksum transitions
@ 2026-09-16 09:06 Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Daniel Gustafsson @ 2026-09-16 09:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Revert online data checksum transitions

The feature to enable, or disable, data checksums in an online
cluster saw a number of postcommit fixes during the beta period.
Suspicions were raised about the risk of more issues surfacing
after GA.  To avoid shipping code which may have bugs, this
reverts in full, or in part, the following commits:

aaf8b9989f7, cd857dec0e0, 5fee7cab1b8, 25b922ec582, 8fb8ded8895,
b3a37ffbc5b, abac86c7a27, 3a18526e8d6, 01805b7d16b, 343d98c3601,
e469e4784ea, 8d22f523245, e5e1f6dc795, 5ab239c9a90, 0ca1b301059,
9a39056c418, 2018bd61679, 1df361e3d82, bf25e5571b3, 381d19da153,
b120358c612, 07009121c23, d771b0a907e, f19c0eccae9, 0907112d388,
397f0fd06ed, 602f19c84ca, e3a27cad462, 4ae3e98c02c, b364828f825

A few bits remain as they have merit on their own:
* The fix for offline checksums not preserving initial state in
  pg_control_init.  The test case for this fix has been moved to
  src/bin/pg_checksums/t/002_actions.pl to survive the revert
  which removed the previous location.
* When a page verification is logged, the additional note which
  informs if the buffer will be zeroed out was kept to aid any
  debugging around checksum failures.
* The Data Checksum section in the docs was kept, but rewritten
  to reflect the current state.
* The enum containing checksum states is kept and some hardcoded
  references to the off state (0) are replaced with the label
  PG_DATA_CHECKSUM_OFF instead.

Discussion: https://postgr.es/m/E15AC050-C4B5-488D-BB2D-3C7AC9F89EA8@yesql.se
Discussion: https://postgr.es/m/anwm6UPxoVS41QA2@bdtpg
Discussion: https://postgr.es/m/CA+Tgmob9NY6m0YNFTQ4nFH2d0iC9SQRruDYxfndGKKzh8OC80w@mail.gmail.com
Discussion: https://postgr.es/m/E07A611B-9CF3-4FDB-8CE8-A221E39040EC%40yesql.se

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c05d5ce12366f1008e95b09a0a9b08a49818b0e1

Modified Files
--------------
doc/src/sgml/config.sgml                           |    5 +-
doc/src/sgml/func/func-admin.sgml                  |   79 -
doc/src/sgml/func/func-info.sgml                   |    5 -
doc/src/sgml/glossary.sgml                         |   20 +-
doc/src/sgml/images/Makefile                       |    1 -
doc/src/sgml/images/datachecksums.gv               |   14 -
doc/src/sgml/images/datachecksums.svg              |   81 -
doc/src/sgml/monitoring.sgml                       |  228 +--
doc/src/sgml/ref/pg_basebackup.sgml                |    6 -
doc/src/sgml/ref/pg_checksums.sgml                 |   12 +-
doc/src/sgml/regress.sgml                          |   14 -
doc/src/sgml/release-19.sgml                       |   35 -
doc/src/sgml/wal.sgml                              |  185 +-
src/backend/access/rmgrdesc/xlogdesc.c             |   58 +-
src/backend/access/transam/xlog.c                  |  552 +-----
src/backend/backup/basebackup.c                    |   90 +-
src/backend/catalog/system_views.sql               |   19 -
src/backend/commands/dbcommands.c                  |   34 -
src/backend/postmaster/Makefile                    |    1 -
src/backend/postmaster/auxprocess.c                |   28 -
src/backend/postmaster/bgworker.c                  |    9 -
src/backend/postmaster/datachecksum_state.c        | 1979 --------------------
src/backend/postmaster/meson.build                 |    1 -
src/backend/postmaster/postmaster.c                |    5 -
src/backend/replication/logical/decode.c           |   16 -
src/backend/storage/ipc/procsignal.c               |    8 -
src/backend/storage/page/README                    |    4 +-
src/backend/storage/page/bufpage.c                 |   18 +-
src/backend/utils/activity/pgstat_backend.c        |    2 -
src/backend/utils/activity/pgstat_io.c             |   35 -
src/backend/utils/activity/wait_event_names.txt    |    3 -
src/backend/utils/adt/pgstatfuncs.c                |    8 +-
src/backend/utils/init/miscinit.c                  |    3 +-
src/backend/utils/init/postinit.c                  |   30 +-
src/backend/utils/misc/guc_parameters.dat          |    6 +-
src/backend/utils/misc/guc_tables.c                |    9 +-
src/backend/utils/misc/pg_controldata.c            |    9 +-
src/backend/utils/misc/postgresql.conf.sample      |   10 +-
src/bin/pg_checksums/t/002_actions.pl              |    5 +
src/bin/pg_controldata/pg_controldata.c            |    2 -
src/bin/pg_upgrade/controldata.c                   |    9 -
src/bin/pg_waldump/t/001_basic.pl                  |    3 +-
src/include/access/rmgrlist.h                      |    1 -
src/include/access/xlog.h                          |   20 +-
src/include/access/xlog_internal.h                 |    6 -
src/include/catalog/catversion.h                   |    2 +-
src/include/catalog/pg_control.h                   |    9 +-
src/include/catalog/pg_proc.dat                    |   12 -
src/include/commands/progress.h                    |   16 -
src/include/miscadmin.h                            |   10 -
src/include/postmaster/datachecksum_state.h        |   28 -
src/include/postmaster/proctypelist.h              |    2 -
src/include/replication/decode.h                   |    1 -
src/include/storage/checksum.h                     |   11 +-
src/include/storage/lwlocklist.h                   |    1 -
src/include/storage/procsignal.h                   |    4 -
src/include/storage/subsystemlist.h                |    1 -
src/include/utils/backend_progress.h               |    1 -
src/test/modules/Makefile                          |    1 -
src/test/modules/meson.build                       |    1 -
src/test/modules/test_checksums/.gitignore         |    2 -
src/test/modules/test_checksums/Makefile           |   36 -
src/test/modules/test_checksums/README             |   30 -
src/test/modules/test_checksums/meson.build        |   40 -
src/test/modules/test_checksums/t/001_basic.pl     |  221 ---
src/test/modules/test_checksums/t/002_restarts.pl  |  160 --
.../test_checksums/t/003_standby_restarts.pl       |  288 ---
src/test/modules/test_checksums/t/004_offline.pl   |  108 --
src/test/modules/test_checksums/t/005_injection.pl |  215 ---
.../modules/test_checksums/t/006_pgbench_single.pl |  285 ---
.../test_checksums/t/007_pgbench_standby.pl        |  411 ----
src/test/modules/test_checksums/t/008_pitr.pl      |  192 --
src/test/modules/test_checksums/t/009_fpi.pl       |   64 -
.../test_checksums/t/010_backup_straddle.pl        |  260 ---
.../test_checksums/t/011_standby_straddle.pl       |  249 ---
.../test_checksums/t/DataChecksums/Utils.pm        |  243 ---
.../modules/test_checksums/test_checksums--1.0.sql |   16 -
src/test/modules/test_checksums/test_checksums.c   |  105 --
.../modules/test_checksums/test_checksums.control  |    4 -
src/test/regress/expected/rules.out                |   38 -
src/test/regress/expected/stats.out                |   11 +-
src/tools/pgindent/typedefs.list                   |    6 -
82 files changed, 79 insertions(+), 6673 deletions(-)



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
@ 2026-09-16 11:00 ` Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 19+ messages in thread

From: Fujii Masao @ 2026-09-16 11:00 UTC (permalink / raw)
  To: Daniel Gustafsson <dgustafsson@postgresql.org>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Wed, Sep 16, 2026 at 6:06 PM Daniel Gustafsson
<dgustafsson@postgresql.org> wrote:
>
> Revert online data checksum transitions

It's unfortunate that this feature had to be reverted...
Anyway, thanks for all your hard work on it!!


After the revert, the buildfarm member longfin reported the test failure [1],
which seems to have been caused by the revert.

According to longfin's server log, the test triggers the following
assertion failure:

    TRAP: failed Assert("(data - start) == data_size"), File:
"heaptuple.c", Line: 442, PID: 78459
    ...
    2026-09-16 06:03:57.172 EDT [77693:4] LOG:  client backend (PID
78459) was terminated by signal 6: Abort trap: 6
    2026-09-16 06:03:57.172 EDT [77693:5] DETAIL:  Failed process was
running: SELECT count(*) > 0 AS ok FROM pg_control_checkpoint();

After the revert, pg_control_checkpoint() now returns 19 columns, but its
pg_proc.dat entry still declares 20 output columns, including
data_page_checksum_version. This seems to trigger the assertion failure
in heap_form_tuple().

We should remove data_page_checksum_version from the pg_control_checkpoint
entry in pg_proc.dat and reduce proargmodes from 20 output columns to 19?

Regards,

[1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=longfin&dt=2026-09-16%2010%3A01%3A48

-- 
Fujii Masao





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
@ 2026-09-16 11:08   ` Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 12:32     ` Re: pgsql: Revert online data checksum transitions Aleksander Alekseev <aleksander@tigerdata.com>
  2026-09-16 15:49     ` Re: pgsql: Revert online data checksum transitions Tom Lane <tgl@sss.pgh.pa.us>
  2026-09-17 03:36     ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  0 siblings, 3 replies; 19+ messages in thread

From: Daniel Gustafsson @ 2026-09-16 11:08 UTC (permalink / raw)
  To: Masao Fujii <masao.fujii@gmail.com>; +Cc: Daniel Gustafsson <dgustafsson@postgresql.org>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

> On 16 Sep 2026, at 13:01, Fujii Masao <masao.fujii@gmail.com> wrote:
> 
> On Wed, Sep 16, 2026 at 6:06 PM Daniel Gustafsson
> <dgustafsson@postgresql.org> wrote:
>> 
>> Revert online data checksum transitions
> 
> It's unfortunate that this feature had to be reverted...
> Anyway, thanks for all your hard work on it!!
> 
> 
> After the revert, the buildfarm member longfin reported the test failure [1],
> which seems to have been caused by the revert.
> 
> According to longfin's server log, the test triggers the following
> assertion failure:
> 
>    TRAP: failed Assert("(data - start) == data_size"), File:
> "heaptuple.c", Line: 442, PID: 78459
>    ...
>    2026-09-16 06:03:57.172 EDT [77693:4] LOG:  client backend (PID
> 78459) was terminated by signal 6: Abort trap: 6
>    2026-09-16 06:03:57.172 EDT [77693:5] DETAIL:  Failed process was
> running: SELECT count(*) > 0 AS ok FROM pg_control_checkpoint();
> 
> After the revert, pg_control_checkpoint() now returns 19 columns, but its
> pg_proc.dat entry still declares 20 output columns, including
> data_page_checksum_version. This seems to trigger the assertion failure
> in heap_form_tuple().
> 
> We should remove data_page_checksum_version from the pg_control_checkpoint
> entry in pg_proc.dat and reduce proargmodes from 20 output columns to 19?

Ugh, I thought I had tested everything but clearly missed this one. Will fix immediately when back from lunch.

./daniel





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
@ 2026-09-16 12:32     ` Aleksander Alekseev <aleksander@tigerdata.com>
  2026-09-16 12:43       ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2 siblings, 1 reply; 19+ messages in thread

From: Aleksander Alekseev @ 2026-09-16 12:32 UTC (permalink / raw)
  To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; +Cc: Daniel Gustafsson <daniel@yesql.se>; Daniel Gustafsson <dgustafsson@postgresql.org>; Masao Fujii <masao.fujii@gmail.com>

Hi Daniel,

> [...]
>
> > We should remove data_page_checksum_version from the pg_control_checkpoint
> > entry in pg_proc.dat and reduce proargmodes from 20 output columns to 19?
>
> Ugh, I thought I had tested everything but clearly missed this one. Will fix immediately when back from lunch.

I noticed that the revert was applied to REL_19_STABLE but not the
master branch. Just wanted to make sure that's the plan.

-- 
Best regards,
Aleksander Alekseev





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 12:32     ` Re: pgsql: Revert online data checksum transitions Aleksander Alekseev <aleksander@tigerdata.com>
@ 2026-09-16 12:43       ` Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 12:58         ` Re: pgsql: Revert online data checksum transitions Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Daniel Gustafsson @ 2026-09-16 12:43 UTC (permalink / raw)
  To: Aleksander Alekseev <aleksander@tigerdata.com>; +Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; Masao Fujii <masao.fujii@gmail.com>

> On 16 Sep 2026, at 14:32, Aleksander Alekseev <aleksander@tigerdata.com> wrote:

>>> We should remove data_page_checksum_version from the pg_control_checkpoint
>>> entry in pg_proc.dat and reduce proargmodes from 20 output columns to 19?
>> 
>> Ugh, I thought I had tested everything but clearly missed this one. Will fix immediately when back from lunch.
> 
> I noticed that the revert was applied to REL_19_STABLE but not the
> master branch. Just wanted to make sure that's the plan.

That's indeed the plan.  The remaining issue that a user can, under the right
set of circumstances, get a false positive page verification in an orphaned
file failure during base backup.  The warning is harmless for data integrity,
but is non-trivial for the user to resolve since we don't provide any tools for
dealing with orphaned files.  Fixing this in master will reduce churn.

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 12:32     ` Re: pgsql: Revert online data checksum transitions Aleksander Alekseev <aleksander@tigerdata.com>
  2026-09-16 12:43       ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
@ 2026-09-16 12:58         ` Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
  2026-09-16 13:04           ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 19+ messages in thread

From: Manuel Reyes Bravo @ 2026-09-16 12:58 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Aleksander Alekseev <aleksander@tigerdata.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; Masao Fujii <masao.fujii@gmail.com>

Daniel Gustafsson <dgustafsson@postgresql.org> wrote:
> Ugh, I thought I had tested everything but clearly missed this one. Will fix immediately when back from lunch.

While you are at it: the revert removes RM_XLOG2_ID and its records but
leaves XLOG_PAGE_MAGIC at 0xD121 on REL_19_STABLE.  0xD121 was set on
2026-07-15 by b01c31eef9c, after the feature had added XLOG2 on
2026-04-03, and it is what 19beta3 shipped with.  So WAL written by
19beta3 and WAL written by 19.0 now carry the same magic but are not
the same format.

To check, I enabled checksums online on 19beta3 and read the WAL with
the pg_waldump of REL_19_STABLE at d8408e8d682:

  19beta3's pg_waldump -r XLOG2:
    rmgr: XLOG2 ... lsn: 0/0157F5A8 ... desc: CHECKSUMS inprogress-on
    rmgr: XLOG2 ... lsn: 0/02DC9AD8 ... desc: CHECKSUMS on

  REL_19_STABLE's pg_waldump, same segments:
    pg_waldump: error: could not find a valid record after 0/0157F5A8:
    invalid resource manager ID 22 at 0/0157F5A8

  REL_19_STABLE's pg_waldump with XLOG_PAGE_MAGIC bumped:
    pg_waldump: error: could not find a valid record after 0/0157F5A8:
    invalid magic number D121 in WAL segment 000000010000000000000001,
    LSN 0/01000000, offset 0

The server itself is not at risk, since PG_CONTROL_VERSION was bumped
and 19.0 refuses a beta3 data directory; it is only tools reading
archived beta3 WAL that cannot tell the formats apart.  But the revert
of 0d3dba38c77 on this branch (01a80f06214) bumped the magic for the
same reason, so it looks like this one should too.  Note that master is
already at 0xD122, for a different format.

The script is attached, in case it is useful.

Regards,
Manu

Attachments:

  [application/x-shellscript] xlog2_magic_demo.sh (1.7K, ../../CA+bCEdDj_Q2Fpkzm_OjUEDMrNhz1X6bsLcaDAepCaUVxT8SoZw@mail.gmail.com/2-xlog2_magic_demo.sh)
  download

^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 12:32     ` Re: pgsql: Revert online data checksum transitions Aleksander Alekseev <aleksander@tigerdata.com>
  2026-09-16 12:43       ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 12:58         ` Re: pgsql: Revert online data checksum transitions Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
@ 2026-09-16 13:04           ` Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 14:08             ` Re: pgsql: Revert online data checksum transitions Heikki Linnakangas <hlinnaka@iki.fi>
  0 siblings, 1 reply; 19+ messages in thread

From: Daniel Gustafsson @ 2026-09-16 13:04 UTC (permalink / raw)
  To: Manuel Reyes Bravo <manuelreyesbravo@gmail.com>; +Cc: Aleksander Alekseev <aleksander@tigerdata.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; Masao Fujii <masao.fujii@gmail.com>

> On 16 Sep 2026, at 14:58, Manuel Reyes Bravo <manuelreyesbravo@gmail.com> wrote:

> The server itself is not at risk, since PG_CONTROL_VERSION was bumped
> and 19.0 refuses a beta3 data directory; it is only tools reading
> archived beta3 WAL that cannot tell the formats apart.  But the revert
> of 0d3dba38c77 on this branch (01a80f06214) bumped the magic for the
> same reason, so it looks like this one should too.

Thanks for the report, will include when fixing.

--
Daniel Gustafsson







^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 12:32     ` Re: pgsql: Revert online data checksum transitions Aleksander Alekseev <aleksander@tigerdata.com>
  2026-09-16 12:43       ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 12:58         ` Re: pgsql: Revert online data checksum transitions Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
  2026-09-16 13:04           ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
@ 2026-09-16 14:08             ` Heikki Linnakangas <hlinnaka@iki.fi>
  2026-09-16 15:52               ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 19+ messages in thread

From: Heikki Linnakangas @ 2026-09-16 14:08 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; Manuel Reyes Bravo <manuelreyesbravo@gmail.com>; +Cc: Aleksander Alekseev <aleksander@tigerdata.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; Masao Fujii <masao.fujii@gmail.com>

On 16/09/2026 16:04, Daniel Gustafsson wrote:
>> On 16 Sep 2026, at 14:58, Manuel Reyes Bravo <manuelreyesbravo@gmail.com> wrote:
> 
>> The server itself is not at risk, since PG_CONTROL_VERSION was bumped
>> and 19.0 refuses a beta3 data directory; it is only tools reading
>> archived beta3 WAL that cannot tell the formats apart.  But the revert
>> of 0d3dba38c77 on this branch (01a80f06214) bumped the magic for the
>> same reason, so it looks like this one should too.
> 
> Thanks for the report, will include when fixing.

Also, the ControlFile->data_checksum_version_init is now never set.

- Heikki







^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 12:32     ` Re: pgsql: Revert online data checksum transitions Aleksander Alekseev <aleksander@tigerdata.com>
  2026-09-16 12:43       ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 12:58         ` Re: pgsql: Revert online data checksum transitions Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
  2026-09-16 13:04           ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 14:08             ` Re: pgsql: Revert online data checksum transitions Heikki Linnakangas <hlinnaka@iki.fi>
@ 2026-09-16 15:52               ` Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 0 replies; 19+ messages in thread

From: Daniel Gustafsson @ 2026-09-16 15:52 UTC (permalink / raw)
  To: Heikki Linnakangas <hlinnaka@iki.fi>; +Cc: Manuel Reyes Bravo <manuelreyesbravo@gmail.com>; Aleksander Alekseev <aleksander@tigerdata.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; Masao Fujii <masao.fujii@gmail.com>

> On 16 Sep 2026, at 16:08, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> 
> On 16/09/2026 16:04, Daniel Gustafsson wrote:
>>> On 16 Sep 2026, at 14:58, Manuel Reyes Bravo <manuelreyesbravo@gmail.com> wrote:
>>> The server itself is not at risk, since PG_CONTROL_VERSION was bumped
>>> and 19.0 refuses a beta3 data directory; it is only tools reading
>>> archived beta3 WAL that cannot tell the formats apart.  But the revert
>>> of 0d3dba38c77 on this branch (01a80f06214) bumped the magic for the
>>> same reason, so it looks like this one should too.
>> Thanks for the report, will include when fixing.
> 
> Also, the ControlFile->data_checksum_version_init is now never set.

This patch is as difficult to back out as it was to get in.  I've been trying
to save a few small generic checksum bugfixes from the revert but that also
made it a lot more complicated.  Will fix this one as well in the follow-up
fixup I have staged for later today.

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
@ 2026-09-16 15:49     ` Tom Lane <tgl@sss.pgh.pa.us>
  2026-09-16 15:50       ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2 siblings, 1 reply; 19+ messages in thread

From: Tom Lane @ 2026-09-16 15:49 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Masao Fujii <masao.fujii@gmail.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

Daniel Gustafsson <daniel@yesql.se> writes:
>> On 16 Sep 2026, at 13:01, Fujii Masao <masao.fujii@gmail.com> wrote:
>> After the revert, the buildfarm member longfin reported the test failure [1],
>> which seems to have been caused by the revert.
>> ...
>> After the revert, pg_control_checkpoint() now returns 19 columns, but its
>> pg_proc.dat entry still declares 20 output columns, including
>> data_page_checksum_version. This seems to trigger the assertion failure
>> in heap_form_tuple().

> Ugh, I thought I had tested everything but clearly missed this one. Will fix immediately when back from lunch.

It seems quite odd to me that only a couple of BF animals are showing
this failure.  Do we understand why that should be?  I can poke into
it on longfin's host if that would help.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 15:49     ` Re: pgsql: Revert online data checksum transitions Tom Lane <tgl@sss.pgh.pa.us>
@ 2026-09-16 15:50       ` Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 17:14         ` Re: pgsql: Revert online data checksum transitions Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 19+ messages in thread

From: Daniel Gustafsson @ 2026-09-16 15:50 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Masao Fujii <masao.fujii@gmail.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

> On 16 Sep 2026, at 17:49, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> I can poke into it on longfin's host if that would help.

That would be great, thanks.

--
Daniel Gustafsson






^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 15:49     ` Re: pgsql: Revert online data checksum transitions Tom Lane <tgl@sss.pgh.pa.us>
  2026-09-16 15:50       ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
@ 2026-09-16 17:14         ` Tom Lane <tgl@sss.pgh.pa.us>
  2026-09-16 17:33           ` Re: pgsql: Revert online data checksum transitions Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Tom Lane @ 2026-09-16 17:14 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Masao Fujii <masao.fujii@gmail.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

Daniel Gustafsson <daniel@yesql.se> writes:
>> On 16 Sep 2026, at 17:49, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I can poke into it on longfin's host if that would help.

> That would be great, thanks.

What seems to be happening is

(1) pg_control_checkpoint()'s local values[] and nulls[] arrays
are now of length 19.

(2) But the tupdesc that get_call_result_type() builds from the
pg_proc entry still has 20 columns.

(3) Therefore, heap_form_tuple sees a wrong value for the 19th column
(which does no great damage, since it's still a pass-by-value type)
and then fetches complete garbage from values[19] and nulls[19].

Depending on the stack layout and the phase of the moon, nulls[19]
might read as zero or it might not.  Either case is fine so long as
heap_compute_data_size and heap_fill_tuple/fill_val interpret it the
same way.  However, what I'm seeing as I trace through the crash on
longfin is that nulls[19] has a value that's not either 0 or 1 (not
too surprising), and somehow heap_compute_data_size is interpreting
that as "true" while fill_val is reading it as "false".  According
to my understanding of the C standard, fill_val is in the wrong here.
I looked at the generated assembly code and could not spot exactly
what the problem is; it seems to be testing the byte value with

        .loc    0 301 7 is_stmt 1               ## heaptuple.c:301:7
        testb   %al, %al
        je      LBB3_6

which certainly looks like it ought to treat all nonzero values alike.
Anyway this seems to be a code generation quirk of certain versions of
clang.  It's probably not worth chasing further.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 15:49     ` Re: pgsql: Revert online data checksum transitions Tom Lane <tgl@sss.pgh.pa.us>
  2026-09-16 15:50       ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 17:14         ` Re: pgsql: Revert online data checksum transitions Tom Lane <tgl@sss.pgh.pa.us>
@ 2026-09-16 17:33           ` Jacob Champion <jacob.champion@enterprisedb.com>
  2026-09-16 17:39             ` Re: pgsql: Revert online data checksum transitions Bryan Green <dbryan.green@gmail.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Jacob Champion @ 2026-09-16 17:33 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Daniel Gustafsson <daniel@yesql.se>; Masao Fujii <masao.fujii@gmail.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Wed, Sep 16, 2026 at 10:14 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> However, what I'm seeing as I trace through the crash on
> longfin is that nulls[19] has a value that's not either 0 or 1 (not
> too surprising), and somehow heap_compute_data_size is interpreting
> that as "true" while fill_val is reading it as "false".  According
> to my understanding of the C standard, fill_val is in the wrong here.

Is the _Bool representation allowed to contain anything but zero/false
or one/true? I thought that was undefined behavior. (IIRC, mixing C++
bool with our C89-era bool definition suffered from similar UB
excitement.)

--Jacob





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 15:49     ` Re: pgsql: Revert online data checksum transitions Tom Lane <tgl@sss.pgh.pa.us>
  2026-09-16 15:50       ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 17:14         ` Re: pgsql: Revert online data checksum transitions Tom Lane <tgl@sss.pgh.pa.us>
  2026-09-16 17:33           ` Re: pgsql: Revert online data checksum transitions Jacob Champion <jacob.champion@enterprisedb.com>
@ 2026-09-16 17:39             ` Bryan Green <dbryan.green@gmail.com>
  2026-09-16 17:44               ` Re: pgsql: Revert online data checksum transitions Bryan Green <dbryan.green@gmail.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Bryan Green @ 2026-09-16 17:39 UTC (permalink / raw)
  To: Jacob Champion <jacob.champion@enterprisedb.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Daniel Gustafsson <daniel@yesql.se>; Masao Fujii <masao.fujii@gmail.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

If we are pulling in stdbool.h and this is C11...that is undefined behavior
and because it wasn't validly initialized it is an indeterminate-value
read...which means for optimization that the compiler is within its right
to assume it is a 0 or 1 and could test it in different ways depending on
the surrounding code (nonzero test, compare to 1, etc).

On Wed, Sep 16, 2026 at 12:34 PM Jacob Champion <
jacob.champion@enterprisedb.com> wrote:

> On Wed, Sep 16, 2026 at 10:14 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > However, what I'm seeing as I trace through the crash on
> > longfin is that nulls[19] has a value that's not either 0 or 1 (not
> > too surprising), and somehow heap_compute_data_size is interpreting
> > that as "true" while fill_val is reading it as "false".  According
> > to my understanding of the C standard, fill_val is in the wrong here.
>
> Is the _Bool representation allowed to contain anything but zero/false
> or one/true? I thought that was undefined behavior. (IIRC, mixing C++
> bool with our C89-era bool definition suffered from similar UB
> excitement.)
>
> --Jacob
>
>
>

^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 15:49     ` Re: pgsql: Revert online data checksum transitions Tom Lane <tgl@sss.pgh.pa.us>
  2026-09-16 15:50       ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-16 17:14         ` Re: pgsql: Revert online data checksum transitions Tom Lane <tgl@sss.pgh.pa.us>
  2026-09-16 17:33           ` Re: pgsql: Revert online data checksum transitions Jacob Champion <jacob.champion@enterprisedb.com>
  2026-09-16 17:39             ` Re: pgsql: Revert online data checksum transitions Bryan Green <dbryan.green@gmail.com>
@ 2026-09-16 17:44               ` Bryan Green <dbryan.green@gmail.com>
  0 siblings, 0 replies; 19+ messages in thread

From: Bryan Green @ 2026-09-16 17:44 UTC (permalink / raw)
  To: Jacob Champion <jacob.champion@enterprisedb.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Daniel Gustafsson <daniel@yesql.se>; Masao Fujii <masao.fujii@gmail.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

This is the goto example:
https://markshroyer.com/2012/06/c-both-true-and-false/

On Wed, Sep 16, 2026 at 12:39 PM Bryan Green <dbryan.green@gmail.com> wrote:

> If we are pulling in stdbool.h and this is C11...that is undefined
> behavior and because it wasn't validly initialized it is an
> indeterminate-value read...which means for optimization that the compiler
> is within its right to assume it is a 0 or 1 and could test it in different
> ways depending on the surrounding code (nonzero test, compare to 1, etc).
>
> On Wed, Sep 16, 2026 at 12:34 PM Jacob Champion <
> jacob.champion@enterprisedb.com> wrote:
>
>> On Wed, Sep 16, 2026 at 10:14 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> > However, what I'm seeing as I trace through the crash on
>> > longfin is that nulls[19] has a value that's not either 0 or 1 (not
>> > too surprising), and somehow heap_compute_data_size is interpreting
>> > that as "true" while fill_val is reading it as "false".  According
>> > to my understanding of the C standard, fill_val is in the wrong here.
>>
>> Is the _Bool representation allowed to contain anything but zero/false
>> or one/true? I thought that was undefined behavior. (IIRC, mixing C++
>> bool with our C89-era bool definition suffered from similar UB
>> excitement.)
>>
>> --Jacob
>>
>>
>>

^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
@ 2026-09-17 03:36     ` Fujii Masao <masao.fujii@gmail.com>
  2026-09-17 13:27       ` Re: pgsql: Revert online data checksum transitions Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
  2 siblings, 1 reply; 19+ messages in thread

From: Fujii Masao @ 2026-09-17 03:36 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Daniel Gustafsson <dgustafsson@postgresql.org>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

On Wed, Sep 16, 2026 at 8:08 PM Daniel Gustafsson <daniel@yesql.se> wrote:
> Ugh, I thought I had tested everything but clearly missed this one. Will fix immediately when back from lunch.

Here are another comments:

data_checksum_version field in xl_checkpoint_redo struct should be removed?
Otherwise, it seems to be included in WAL records unnecessarily even though
it is no longer used. No?


-       database (or on a shared object), or NULL if data checksums are
-       disabled.
-      </para></entry>
+       database (or on a shared object).  Detected failures are not reset if
+       the <xref linkend="guc-data-checksums"/> setting changes.  Clusters
+       which are initialized without data checksums will show this as
+       <literal>0</literal>. In <productname>PostgreSQL</productname> version
+       18 and earlier, this was set to <literal>NULL</literal> for clusters
+       with data checksums disabled.
+      </para>
+     </entry>
...
-       this database (or on a shared object), or NULL if data checksums are
-       disabled.
+       this database (or on a shared object). Last failure is reported
+       regardless of the <xref linkend="guc-data-checksums"/> setting.

These updates to monitoring.sgml from commit f19c0eccae9 also should be
reverted? checksum_failures and checksum_last_failure seem to return
NULL again when data checksums are disabled, so their descriptions would
otherwise be incorrect.


checksum_enable_offline() and checksum_disable_offline() in
Cluster.pm also seem to be unused now. Should they be removed as well?

Regards,

-- 
Fujii Masao






^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-17 03:36     ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
@ 2026-09-17 13:27       ` Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
  2026-09-17 16:53         ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 19+ messages in thread

From: Manuel Reyes Bravo @ 2026-09-17 13:27 UTC (permalink / raw)
  To: Fujii Masao <masao.fujii@gmail.com>; +Cc: Daniel Gustafsson <daniel@yesql.se>; Daniel Gustafsson <dgustafsson@postgresql.org>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

Fujii Masao <masao.fujii@gmail.com> wrote:
> data_checksum_version field in xl_checkpoint_redo struct should be removed?
> Otherwise, it seems to be included in WAL records unnecessarily even though
> it is no longer used. No?

Agreed.  It is also never assigned now: c05d5ce1236 removed the line in
CreateCheckPoint() that set it, but the whole struct is still
registered, so the main data of each XLOG_CHECKPOINT_REDO record is 8
bytes, 4 of them unset.  Before f19c0eccae9 it was 4 bytes.  In my runs
on REL_19_STABLE at 4a9a6c5a69c the unset bytes happened to be zero.

> These updates to monitoring.sgml from commit f19c0eccae9 also should be
> reverted? checksum_failures and checksum_last_failure seem to return
> NULL again when data checksums are disabled, so their descriptions would
> otherwise be incorrect.

Yes, both pg_stat_get_db_checksum_failures() and
pg_stat_get_db_checksum_last_failure() return NULL when
DataChecksumsEnabled() is false, as they did before f19c0eccae9.

> checksum_enable_offline() and checksum_disable_offline() in
> Cluster.pm also seem to be unused now. Should they be removed as well?

They have no callers left in the tree.

To check whether anything else was left behind, I went through the 30
commits listed in c05d5ce1236 mechanically: the identifiers and the
non-trivial lines they added that are still in REL_19_STABLE and were
not there before f19c0eccae9.  Apart from what the revert keeps on
purpose (the checksum state enum, data_checksum_version_init, the
zeroing note in page verification and the rewritten docs section),
these three are the only ones left.

In case it saves Daniel some time, the attached patch does the three,
against REL_19_STABLE.  The changed parts match the text before
f19c0eccae9.  It builds without warnings, make check passes, the redo
records are back to 4 bytes of data, and the two readers of that data,
pg_waldump and the WAL summarizer (with summarize_wal on), work as
before.

I have not touched XLOG_PAGE_MAGIC.  Nothing has been released since
4a9a6c5a69c bumped it, but pg_waldump or a summarizer built before this
patch would copy 8 bytes out of a 4-byte record, so that is your call.

Regards,
Manu

Attachments:

  [text/x-patch] 0001-Remove-remaining-leftovers-of-the-online-checksums-r.patch (4.0K, ../../CA+bCEdA4QxMc2KYqfuEZofPBYjx_wHLthfk4iDFVRCn+hoF1mg@mail.gmail.com/2-0001-Remove-remaining-leftovers-of-the-online-checksums-r.patch)
  download | inline diff:
From d3d11a61172d6689ffaab7f2c7ed30b7cb66d237 Mon Sep 17 00:00:00 2001
From: Manu <manuelreyesbravo@gmail.com>
Date: Thu, 17 Sep 2026 10:24:01 -0300
Subject: [PATCH] Remove remaining leftovers of the online checksums revert

Commit c05d5ce1236 removed the code that set and read the
data_checksum_version member of xl_checkpoint_redo, but not the member
itself, so every XLOG_CHECKPOINT_REDO record still carried four bytes
that are never assigned.  Remove it; the record data is back to the
four bytes it had before f19c0eccae9.

Also restore the descriptions of checksum_failures and
checksum_last_failure, which are NULL again when data checksums are
disabled, and remove the checksum_enable_offline() and
checksum_disable_offline() test helpers, which have no callers left.

Reported-by: Fujii Masao <masao.fujii@gmail.com>
---
 doc/src/sgml/monitoring.sgml             | 15 ++++------
 src/include/access/xlog_internal.h       |  1 -
 src/test/perl/PostgreSQL/Test/Cluster.pm | 36 ------------------------
 3 files changed, 5 insertions(+), 47 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 86982079362..fe31b7b62ec 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -3902,14 +3902,9 @@ description | Waiting for a newly initialized WAL file to reach durable storage
       </para>
       <para>
        Number of data page checksum failures detected in this
-       database (or on a shared object).  Detected failures are not reset if
-       the <xref linkend="guc-data-checksums"/> setting changes.  Clusters
-       which are initialized without data checksums will show this as
-       <literal>0</literal>. In <productname>PostgreSQL</productname> version
-       18 and earlier, this was set to <literal>NULL</literal> for clusters
-       with data checksums disabled.
-      </para>
-     </entry>
+       database (or on a shared object), or NULL if data checksums are
+       disabled.
+      </para></entry>
      </row>
 
      <row>
@@ -3918,8 +3913,8 @@ description | Waiting for a newly initialized WAL file to reach durable storage
       </para>
       <para>
        Time at which the last data page checksum failure was detected in
-       this database (or on a shared object). Last failure is reported
-       regardless of the <xref linkend="guc-data-checksums"/> setting.
+       this database (or on a shared object), or NULL if data checksums are
+       disabled.
       </para></entry>
      </row>
 
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h
index 6639dc19e32..7503c49f203 100644
--- a/src/include/access/xlog_internal.h
+++ b/src/include/access/xlog_internal.h
@@ -308,7 +308,6 @@ typedef struct xl_end_of_recovery
 typedef struct xl_checkpoint_redo
 {
 	int			wal_level;
-	uint32		data_checksum_version;
 } xl_checkpoint_redo;
 
 /*
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index 366519e22b5..da8d5516b53 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -3992,42 +3992,6 @@ sub advance_wal
 	}
 }
 
-=item $node->checksum_enable_offline()
-
-Enable data page checksums in an offline cluster with B<pg_checksums>. The
-caller is responsible for ensuring that the cluster is in the right state for
-this operation.
-
-=cut
-
-sub checksum_enable_offline
-{
-	my ($self) = @_;
-
-	print "# Enabling checksums in \"$self->data_dir\"\n";
-	PostgreSQL::Test::Utils::system_or_bail('pg_checksums', '-D',
-		$self->data_dir, '-e');
-	return;
-}
-
-=item $node->checksum_disable_offline()
-
-Disable data page checksums in an offline cluster with B<pg_checksums>. The
-caller is responsible for ensuring that the cluster is in the right state for
-this operation.
-
-=cut
-
-sub checksum_disable_offline
-{
-	my ($self) = @_;
-
-	print "# Disabling checksums in \"$self->data_dir\"\n";
-	PostgreSQL::Test::Utils::system_or_bail('pg_checksums', '-D',
-		$self->data_dir, '-d');
-	return;
-}
-
 =pod
 
 =back
-- 
2.55.0



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-17 03:36     ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-17 13:27       ` Re: pgsql: Revert online data checksum transitions Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
@ 2026-09-17 16:53         ` Daniel Gustafsson <daniel@yesql.se>
  2026-09-17 22:22           ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 19+ messages in thread

From: Daniel Gustafsson @ 2026-09-17 16:53 UTC (permalink / raw)
  To: Manuel Reyes Bravo <manuelreyesbravo@gmail.com>; +Cc: Fujii Masao <masao.fujii@gmail.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

> On 17 Sep 2026, at 15:27, Manuel Reyes Bravo <manuelreyesbravo@gmail.com> wrote:

> In case it saves Daniel some time, the attached patch does the three,
> against REL_19_STABLE.

Thanks, I also went over the commits today so I'll compare notes before
applying to v19 later today.

--
Daniel Gustafsson







^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: pgsql: Revert online data checksum transitions
  2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
  2026-09-16 11:00 ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-16 11:08   ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
  2026-09-17 03:36     ` Re: pgsql: Revert online data checksum transitions Fujii Masao <masao.fujii@gmail.com>
  2026-09-17 13:27       ` Re: pgsql: Revert online data checksum transitions Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
  2026-09-17 16:53         ` Re: pgsql: Revert online data checksum transitions Daniel Gustafsson <daniel@yesql.se>
@ 2026-09-17 22:22           ` Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 0 replies; 19+ messages in thread

From: Daniel Gustafsson @ 2026-09-17 22:22 UTC (permalink / raw)
  To: Manuel Reyes Bravo <manuelreyesbravo@gmail.com>; +Cc: Masao Fujii <masao.fujii@gmail.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>

> On 17 Sep 2026, at 18:54, Daniel Gustafsson <daniel@yesql.se> wrote:
> 
> 
>> 
>>> On 17 Sep 2026, at 15:27, Manuel Reyes Bravo <manuelreyesbravo@gmail.com> wrote:
>> 
>> In case it saves Daniel some time, the attached patch does the three,
>> against REL_19_STABLE.
> 
> Thanks, I also went over the commits today so I'll compare notes before
> applying to v19 later today.

I’ve applied this now. I originally kept the Test code in place ro minimize backpatching conflict risks there but after thinking further I ended up removing it as well.

./daniel





^ permalink  raw  reply  [nested|flat] 19+ messages in thread


end of thread, other threads:[~2026-09-17 22:22 UTC | newest]

Thread overview: 19+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 09:06 pgsql: Revert online data checksum transitions Daniel Gustafsson <dgustafsson@postgresql.org>
2026-09-16 11:00 ` Fujii Masao <masao.fujii@gmail.com>
2026-09-16 11:08   ` Daniel Gustafsson <daniel@yesql.se>
2026-09-16 12:32     ` Aleksander Alekseev <aleksander@tigerdata.com>
2026-09-16 12:43       ` Daniel Gustafsson <daniel@yesql.se>
2026-09-16 12:58         ` Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
2026-09-16 13:04           ` Daniel Gustafsson <daniel@yesql.se>
2026-09-16 14:08             ` Heikki Linnakangas <hlinnaka@iki.fi>
2026-09-16 15:52               ` Daniel Gustafsson <daniel@yesql.se>
2026-09-16 15:49     ` Tom Lane <tgl@sss.pgh.pa.us>
2026-09-16 15:50       ` Daniel Gustafsson <daniel@yesql.se>
2026-09-16 17:14         ` Tom Lane <tgl@sss.pgh.pa.us>
2026-09-16 17:33           ` Jacob Champion <jacob.champion@enterprisedb.com>
2026-09-16 17:39             ` Bryan Green <dbryan.green@gmail.com>
2026-09-16 17:44               ` Bryan Green <dbryan.green@gmail.com>
2026-09-17 03:36     ` Fujii Masao <masao.fujii@gmail.com>
2026-09-17 13:27       ` Manuel Reyes Bravo <manuelreyesbravo@gmail.com>
2026-09-17 16:53         ` Daniel Gustafsson <daniel@yesql.se>
2026-09-17 22:22           ` Daniel Gustafsson <daniel@yesql.se>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox