=== Applying patches on top of PostgreSQL commit ID 15d33eb1924c1093102b8ce142ede4cb3912e85e === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Thu Jul 24 16:52:20 UTC 2025 On branch cf/5124 nothing to commit, working tree clean === using 'git am' to apply patch ./v1-0001-Fix-pg_control-corruption-in-EXEC_BACKEND-startup.patch === Applying: Fix pg_control corruption in EXEC_BACKEND startup. Using index info to reconstruct a base tree... M src/backend/access/transam/xlog.c M src/backend/postmaster/launch_backend.c M src/include/access/xlog.h Falling back to patching base and 3-way merge... Auto-merging src/include/access/xlog.h Auto-merging src/backend/postmaster/launch_backend.c CONFLICT (content): Merge conflict in src/backend/postmaster/launch_backend.c Auto-merging src/backend/access/transam/xlog.c CONFLICT (content): Merge conflict in src/backend/access/transam/xlog.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Fix pg_control corruption in EXEC_BACKEND startup. When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M src/backend/access/transam/xlog.c M src/backend/postmaster/launch_backend.c M src/include/access/xlog.h === using patch(1) to apply patch ./v1-0001-Fix-pg_control-corruption-in-EXEC_BACKEND-startup.patch === patching file src/backend/access/transam/xlog.c Hunk #1 succeeded at 583 (offset 15 lines). Hunk #2 succeeded at 705 with fuzz 1 (offset 15 lines). Hunk #3 FAILED at 4314. Hunk #4 succeeded at 4506 (offset 157 lines). Hunk #5 succeeded at 5023 (offset 194 lines). Hunk #6 succeeded at 5168 (offset 194 lines). 1 out of 6 hunks FAILED -- saving rejects to file src/backend/access/transam/xlog.c.rej patching file src/backend/postmaster/launch_backend.c Hunk #1 FAILED at 34. Hunk #2 succeeded at 132 with fuzz 2 (offset -3 lines). Hunk #3 succeeded at 697 (offset 46 lines). Hunk #4 succeeded at 784 with fuzz 2 (offset 36 lines). Hunk #5 succeeded at 1060 (offset 38 lines). 1 out of 5 hunks FAILED -- saving rejects to file src/backend/postmaster/launch_backend.c.rej patching file src/include/access/xlog.h Hunk #1 succeeded at 197 (offset 2 lines). Hunk #2 succeeded at 238 with fuzz 1 (offset 3 lines). Unstaged changes after reset: M src/backend/access/transam/xlog.c M src/backend/postmaster/launch_backend.c M src/include/access/xlog.h Removing src/backend/access/transam/xlog.c.rej Removing src/backend/postmaster/launch_backend.c.rej === using 'git apply' to apply patch ./v1-0001-Fix-pg_control-corruption-in-EXEC_BACKEND-startup.patch === Applied patch to 'src/backend/access/transam/xlog.c' with conflicts. Applied patch to 'src/backend/postmaster/launch_backend.c' with conflicts. Applied patch to 'src/include/access/xlog.h' cleanly. U src/backend/access/transam/xlog.c U src/backend/postmaster/launch_backend.c diff --cc src/backend/access/transam/xlog.c index eefffc4277a,b69a0d95af9..00000000000 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@@ -698,9 -687,10 +702,10 @@@ static void ValidateXLOGDirectoryStruct static void CleanupBackupHistory(void); static void UpdateMinRecoveryPoint(XLogRecPtr lsn, bool force); static bool PerformRecoveryXLogAction(void); -static void InitControlFile(uint64 sysidentifier); +static void InitControlFile(uint64 sysidentifier, uint32 data_checksum_version); static void WriteControlFile(void); static void ReadControlFile(void); + static void ScanControlFile(void); static void UpdateControlFile(void); static char *str_time(pg_time_t tnow); @@@ -4466,9 -4314,7 +4471,11 @@@ WriteControlFile(void static void ReadControlFile(void) { - pg_crc32c crc; int fd; ++<<<<<<< ours + char wal_segsz_str[20]; ++======= ++>>>>>>> theirs int r; /* diff --cc src/backend/postmaster/launch_backend.c index bf6b55ee830,40efe738ae1..00000000000 --- a/src/backend/postmaster/launch_backend.c +++ b/src/backend/postmaster/launch_backend.c @@@ -33,9 -33,16 +33,15 @@@ #include ++<<<<<<< ours ++======= + #include "access/xlog.h" + #include "catalog/pg_control.h" + #include "common/file_utils.h" ++>>>>>>> theirs #include "libpq/libpq-be.h" -#include "libpq/pqsignal.h" #include "miscadmin.h" -#include "nodes/queryjumble.h" -#include "port.h" #include "postmaster/autovacuum.h" -#include "postmaster/auxprocess.h" #include "postmaster/bgworker_internals.h" #include "postmaster/bgwriter.h" #include "postmaster/fork_process.h" @@@ -130,8 -136,14 +136,16 @@@ typedef struc char my_exec_path[MAXPGPATH]; char pkglib_path[MAXPGPATH]; + int MyPMChildSlot; + + /* + * A copy of the ControlFileData from early in Postmaster startup. We + * need to access its contents it at a phase of initialization before we + * are allowed to acquire LWLocks, so we can't just use shared memory or + * read the file from disk. + */ + ControlFileData proto_controlfile; + /* * These are only used by backend processes, but are here because passing * a socket needs some special handling on Windows. 'client_sock' is an @@@ -780,8 -748,9 +788,10 @@@ save_backend_variables(BackendParameter param->max_safe_fds = max_safe_fds; param->MaxBackends = MaxBackends; + param->num_pmchild_slots = num_pmchild_slots; + ExportProtoControlFile(¶m->proto_controlfile); + #ifdef WIN32 param->PostmasterHandle = PostmasterHandle; if (!write_duplicated_handle(¶m->initial_signal_pipe,