Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x1OM7-005A4B-37 for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Sep 2026 13:16:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x1OM6-006JxL-29 for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Sep 2026 13:16:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x0j1s-00Dwqt-0k for pgsql-bugs@lists.postgresql.org; Sun, 30 Aug 2026 17:09:12 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x0j1n-000000023uj-1LAE for pgsql-bugs@lists.postgresql.org; Sun, 30 Aug 2026 17:09:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=Nw9xObz0dPG8RTYJ3GSX2u893Y0wIXl+weJMn+4ppxI=; b=UlWjY9tPiaMwPnSDFEWR8zkErN 02V7Lj+x7gU65B8Kwcigo/AglUCC1OZcCmTego8QnBfN1cRzZaPDb0dJpI5zAgM1dOtIPMCSpywzR 7a7qNXwn8UjFH/8ZZBP4TOMLLBfRW4mpm7HJkSuuMT2UIlsHFBgr1W+SXgHnFT4fcrmJ5dJSKANJd exYf83R6f21PyTkOvWMAvFw/RpdGBtiyCaIO+D3WPfQ6hFr62GhERlUaQN7hz48var2ikYV71PVdI cP53eNujPkX78QEJvNr/WDFIQ7GcS+THEIH9YVtxWvcw/tnzQ5JMKq46swDBohn6YfBwbMjv2JVg8 LCoEZA5w==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x0j1k-009fth-2N for pgsql-bugs@lists.postgresql.org; Sun, 30 Aug 2026 17:09:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x0j1j-00000008Xej-182q for pgsql-bugs@lists.postgresql.org; Sun, 30 Aug 2026 17:09:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19647: Difference in pg_basebackup behaviour between PostgreSQL <= 16 and >= 17 with pgactive extension To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: edwin.polkerman@splendiddata.com Reply-To: edwin.polkerman@splendiddata.com, pgsql-bugs@lists.postgresql.org Date: Sun, 30 Aug 2026 17:08:49 +0000 Message-ID: <19647-d18354ebe2134a6d@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19647 Logged by: Edwin Polkerman Email address: edwin.polkerman@splendiddata.com PostgreSQL version: 15.19 Operating system: Linux (See details) Description: =20 Operating system: I have tested this on SUSE15 SP7 x86_64 and ppc64le, RHEL8/9 x86_64 and ppc64le, RHEL10 x86_64, Rocky Linux 8/9/10 x86_64 and every time having the same results. The start situation is a postgresql instance (data checksums on) with extension pgactive (version 2.1.8) installed in a database (CREATE EXTENSION pgactive;), in "shared_preload_libraries" and added to new parameter "output_plugin_libraries". Following step is to take an base backup with pg_basebackup. In PostgreSQL versions 18.6 and 17.11 this succeeds without any problem. However in PostgreSQL versions 16.15, 15.19 and 14.24 the backup process fails. FAIL SITUATION: postgres=3D# select version(); version ---------------------------------------------------------------------------= ----------- PostgreSQL 15.19 on x86_64-pc-linux-gnu, compiled by gcc (SUSE Linux) 14.3.0, 64-bit (1 row) postgres=3D# select name, setting, category, short_desc from pg_settings wh= ere name=3D'data_checksums'; name | setting | category | short_desc ----------------+---------+----------------+-------------------------------= ------------------------------- data_checksums | on | Preset Options | Shows whether data checksums are turned on for this cluster. (1 row) For database app extension pgactive is installed and configured: postgres=3D# \c app app=3D# SELECT * from pgactive.pgactive_nodes; -[ RECORD 1 ]------+-------------------------------------------------------------------= ----- node_sysid | 7679811947370996481 node_timeline | 0 node_dboid | 16669 node_status | r node_name | endpoint1-app node_dsn | user_mapping=3Dsplendid pgactive_foreign_server=3Dpgactive_server_endpoint1 node_init_from_dsn | node_read_only | f node_seq_id | 1 -[ RECORD 2 ]------+-------------------------------------------------------------------= ----- node_sysid | 7679811972576347006 node_timeline | 0 node_dboid | 16386 node_status | r node_name | endpoint2-app node_dsn | user_mapping=3Dsplendid pgactive_foreign_server=3Dpgactive_server_endpoint2 node_init_from_dsn | user_mapping=3Dsplendid pgactive_foreign_server=3Dpgactive_server_endpoint1 node_read_only | f node_seq_id | 2 Creating an base backup: > pg_basebackup -p 5442 -D /basebackup/backup/15/pg_basebackup_pg15pgactive -X s -P -v -R pg_basebackup: initiating base backup, waiting for checkpoint to complete pg_basebackup: checkpoint completed pg_basebackup: write-ahead log start point: 0/44000028 on timeline 1 pg_basebackup: starting background WAL receiver pg_basebackup: created temporary replication slot "pg_basebackup_14961" pg_basebackup: error: COPY stream ended before last file was finished617_vm) pg_basebackup: removing data directory "/basebackup/backup/15/pg_basebackup_pg15pgactive" Logging from the database server shows following: 2026-08-30 16:31:45 CEST pid:14641 xid:0 ip: LOG: checkpoint starting: force wait 2026-08-30 16:31:45 CEST pid:14641 xid:0 ip: LOG: checkpoint complete: wrote 0 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=3D0.003 s, sync=3D0.001 s, total=3D0.009 s; sync files=3D0, longest= =3D0.000 s, average=3D0.000 s; distance=3D16383 kB, estimate=3D16383 kB 2026-08-30 16:31:48 CEST [unknown] postgres pid:14959 xid:0 ip:[local] ERROR: invalid segment number 0 in file "pgactive.stat" 2026-08-30 16:31:48 CEST [unknown] postgres pid:14959 xid:0 ip:[local] STATEMENT: BASE_BACKUP ( LABEL 'pg_basebackup base backup', PROGRESS, WAIT 0, MANIFEST 'yes', TARGET 'client') 2026-08-30 16:31:48 CEST [unknown] postgres pid:14961 xid:0 ip:[local] LOG: unexpected EOF on standby connection 2026-08-30 16:31:48 CEST [unknown] postgres pid:14961 xid:0 ip:[local] STATEMENT: START_REPLICATION SLOT "pg_basebackup_14961" 0/44000000 TIMELINE 1 The ERROR message shows file pgactive.stat, which is probably placed by the pgactive extension in the "global" directory in PGDATA Stopped the server and run pg_checksum to verify: > pg_checksums -c /var/pgpure/postgres/15/cluster2/ pg_checksums: error: invalid segment number 0 in file name "/var/pgpure/postgres/18/cluster2//global/pgactive.stat" As said, this behaviour is seen for 16.15, 15.19 and 14.24. GOOD SITUATION: postgres=3D# select version(); version ---------------------------------------------------------------------------= ---------- PostgreSQL 18.6 on x86_64-pc-linux-gnu, compiled by gcc (SUSE Linux) 14.3.0, 64-bit (1 row) postgres=3D# select name, setting, category, short_desc from pg_settings wh= ere name=3D'data_checksums'; name | setting | category | short_desc ----------------+---------+----------------+-------------------------------= ------------------------------- data_checksums | on | Preset Options | Shows whether data checksums are turned on for this cluster. (1 row) For database app extension pgactive is installed and configured: postgres=3D# \c app app=3D# SELECT * from pgactive.pgactive_nodes; -[ RECORD 1 ]------+-------------------------------------------------------------------= ----- node_sysid | 7678809857720063909 node_timeline | 0 node_dboid | 16702 node_status | r node_name | endpoint1-app node_dsn | user_mapping=3Dsplendid pgactive_foreign_server=3Dpgactive_server_endpoint1 node_init_from_dsn | node_read_only | f node_seq_id | 1 -[ RECORD 2 ]------+-------------------------------------------------------------------= ----- node_sysid | 7678809889904381387 node_timeline | 0 node_dboid | 16386 node_status | r node_name | endpoint2-app node_dsn | user_mapping=3Dsplendid pgactive_foreign_server=3Dpgactive_server_endpoint2 node_init_from_dsn | user_mapping=3Dsplendid pgactive_foreign_server=3Dpgactive_server_endpoint1 node_read_only | f node_seq_id | 2 Creating an base backup: pg_basebackup -p 5442 -D /basebackup/backup/18/pg_basebackup_pg18pgactive -X s -P -v -R pg_basebackup: initiating base backup, waiting for checkpoint to complete pg_basebackup: checkpoint completed pg_basebackup: write-ahead log start point: 0/55000028 on timeline 1 pg_basebackup: starting background WAL receiver pg_basebackup: created temporary replication slot "pg_basebackup_141732" 372246/372246 kB (100%), 1/1 tablespace pg_basebackup: write-ahead log end point: 0/55000120 pg_basebackup: waiting for background process to finish streaming ... pg_basebackup: syncing data to disk ... pg_basebackup: renaming backup_manifest.tmp to backup_manifest pg_basebackup: base backup completed For PostgreSQL 18.6 and 17.11 the backup completes without any problems. The strange thing is that also here pg_checksums reports about file pgactive.stat??? > pg_checksums -c /var/pgpure/postgres/18/cluster2/ pg_checksums: error: invalid segment number 0 in file name "/var/pgpure/postgres/15/cluster2//global/pgactive.stat"