=== Applying patches on top of PostgreSQL commit ID e8bfad4ca842733b957c01e732ec009778f952cd === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Sat Nov 8 04:54: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 574 (offset 6 lines). Hunk #2 succeeded at 696 with fuzz 2 (offset 6 lines). Hunk #3 FAILED at 4314. Hunk #4 succeeded at 4406 (offset 57 lines). Hunk #5 succeeded at 4907 (offset 78 lines). Hunk #6 succeeded at 5052 (offset 78 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 134 with fuzz 2 (offset -1 lines). Hunk #3 succeeded at 675 (offset 24 lines). Hunk #4 succeeded at 764 with fuzz 2 (offset 16 lines). Hunk #5 succeeded at 1042 (offset 20 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 239 with fuzz 1 (offset 4 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 101b616b028,b69a0d95af9..00000000000 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@@ -689,11 -687,12 +693,12 @@@ 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); +static char *str_time(pg_time_t tnow, char *buf, size_t bufsize); static int get_sync_bit(int method); @@@ -4366,9 -4314,7 +4371,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 976638a58ac,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" @@@ -132,8 -136,14 +138,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 @@@ -760,8 -748,9 +768,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,