BUG #16780: Inconsistent recovery_target_xid handling across platforms
The Post Office <noreply@postgresql.org>
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: exclusion@gmail.com
Date: 2020-12-18T10:00:00Z
Lists: pgsql-bugs
The following bug has been logged on the website: Bug reference: 16780 Logged by: Alexander Lakhin Email address: exclusion@gmail.com PostgreSQL version: 13.1 Operating system: Windows Description: While testing src/test/recovery with a non-zero epoch the inconsistency was discovered. The 003_recovery_targets.pl test with the slight modification passes on Linux x86_64, but fails on Windows x64. The modification is to append just after the $node_master->init: command([ 'pg_resetwal', '--epoch=1', $node_master->data_dir ]); And on Windows I get: t/003_recovery_targets.pl ............ 2/9 Bailout called. Further testing stopped: pg_ctl start failed FAILED--Further testing stopped: pg_ctl start failed regress_log_003_recovery_targets contains: # pg_ctl start failed; logfile: 2020-12-18 12:25:11.597 MSK [1312] LOG: invalid value for parameter "recovery_target_xid": "4294967782" 2020-12-18 12:25:11.597 MSK [1312] FATAL: configuration file ".../src/test/recovery/tmp_check/t_003_recovery_targets_standby_2_data/pgdata/postgresql.conf" contains errors So on Windows the recovery_target_xid parameter doesn't accept 64-bit value. As I see in check_recovery_target_xid() the strtoul() function is used to check/convert the input value, that is later stored into 32-bit variable. Thus, on platforms where unsigned long is 32-bit wide, you can't specify a result of pg_current_xact_id() as recovery_target_xid, while on platforms where unsigned long is 64-bit, you can, but high 32 bits are just ignored.
Commits
-
Fix portability issues with parsing of recovery_target_xid
- 0b54a80a38c7 9.6.21 landed
- f3ee99df7280 10.16 landed
- 35ad5c7c7eed 11.11 landed
- 67a9411d2fca 12.6 landed
- 1e54664eee4b 13.2 landed
- 6db27037b993 14.0 landed