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 1wSmY3-0005oA-38 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2026 02:02:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wSmY1-0012fb-0j for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2026 02:02:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wSmY0-0012fS-2N for pgsql-hackers@lists.postgresql.org; Fri, 29 May 2026 02:02:05 +0000 Received: from mail-australiasoutheastazolkn190100000.outbound.protection.outlook.com ([2a01:111:f403:d40e::] helo=MEUPR01CU001.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wSmXy-000000003AX-3btH for pgsql-hackers@lists.postgresql.org; Fri, 29 May 2026 02:02:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=n9KKwcNwFAMzKUj6NM0wM6Zp8b8dtTzNRjbJeGliE+RTt9eDJSn0Nqj7S7Ts1K2DLuEwo11Yhmqyv0tgUJ9MOivy5JjP4cY1RH03FbPjbHtePSus8O2zEY2h7d04gGTI7HLxLoYn6OmZIXGfyY0hFCqMIkh0hWKWjol9Dr3eL+pDjwKp08k6mwpJtRjAqcPyLSRitl+ODrrmE5j9qHWS68C9bR2XROE7gzR4CI3gA0RxY9qbW8r0JF+7VIU3XSAFoMTLGV1qW3sDuRKvvDVv3FsAye+HJAHXmnIjw5TTv3AuQzSyoHtjk7sQXx+HhCtimfOLMlc/+RtdH1vIHF7YXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LkKCmXVOyKndV9hsPWNz7GOn+A+XUZ8m5FifgAtlOPc=; b=elvu6E6BO4/3VMDJ7yUmCN1Sh/9JEz0ti9quv+bONx7EKGxKMcnhYXuWaYYi7r4pz6UNjBz2QNq75+U17wj/zVINAcyGojGlCuu3pWyE6tXZhn0QY8g+dD4r4o5mi+3RF70oC6wActvX8kYkICPAHKAeQWBhrBeGbTV45woSl7Djks8v/QOEYQZuw9ltW0jZrrMrAl/TYiEnURCOGP8zI872RINOyI0w/EiuJzPv6yLAg0zYI9g+jX+ioHaUO46/D57yG5VR/hw4v1T4j34owXlcDri5YuP88uywGAEGpxC13oc6TKM2eyhj8KPYG6lpnkmvSZONwNzDEe0M0rvCSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LkKCmXVOyKndV9hsPWNz7GOn+A+XUZ8m5FifgAtlOPc=; b=BFbvtoMK8Nh+g6B2ntqM7evT/b0+cZNDHgBDWH8U3eC3snUcb/vq0XLa0A7pb7Ic8SbT6I6WeZJymJVsviKUgsxyk2hoj70VjLDZjevaLJhk1yIUxBBADEEy1usYR5rzBe9Or5V0rHtnnKLoGFujTvc1XB6iFoJs/s6aQvnX4FFloJS2P0R1KbYiCZVgltwPprqr+bbXYGRd0Qo6PCZET4gsLuJtB7sMhguYK0L8jDLWIthIQv04ZMRYz/HIiLp1DFZ6nGKrUklEzrF5hudmgBwt7wCOsZ2M44Tz/D0hKXH5Xgv/IUT+MtjP4NfHDfpNv6wBJvfg10+mPcp6X5OxzQ== Received: from SY7PR01MB10921.ausprd01.prod.outlook.com (2603:10c6:10:334::16) by SY4PR01MB8277.ausprd01.prod.outlook.com (2603:10c6:10:192::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.71.15; Fri, 29 May 2026 02:01:51 +0000 Received: from SY7PR01MB10921.ausprd01.prod.outlook.com ([fe80::7908:e00:4ab1:d120]) by SY7PR01MB10921.ausprd01.prod.outlook.com ([fe80::7908:e00:4ab1:d120%5]) with mapi id 15.21.0071.014; Fri, 29 May 2026 02:01:51 +0000 From: Japin Li To: Mats Kindahl Cc: surya poondla , pgsql-hackers@lists.postgresql.org Subject: Re: pg_rewind does not rewind diverging timelines In-Reply-To: (Mats Kindahl's message of "Tue, 26 May 2026 18:03:32 +0200") References: User-Agent: mu4e 1.14.1; emacs 30.2 Date: Fri, 29 May 2026 10:01:41 +0800 Message-ID: Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: TYCPR01CA0124.jpnprd01.prod.outlook.com (2603:1096:400:26d::10) To SY7PR01MB10921.ausprd01.prod.outlook.com (2603:10c6:10:334::16) X-Microsoft-Original-Message-ID: <87mrxjvure.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SY7PR01MB10921:EE_|SY4PR01MB8277:EE_ X-MS-Office365-Filtering-Correlation-Id: b8bdb4a5-beb7-424d-12c9-08debd263f78 X-Microsoft-Antispam: BCL:0;ARA:14566002|5072599009|22091999003|23021999003|24121999003|24021099003|8060799015|15080799012|19110799012|10035399007|26121999007|440099028|4302099013|3412199025|40105399003|52005399003|1602099012; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?/WTnYrEPlFLy+ZMNAApu3+pECBAoMipFCXTqoCRnhF6B3vmewtayni2J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GC6gGoDwCMrOWqW3yJgsWaOmp?= =?us-ascii?Q?lqNpyXKD/u3hB9hUITI6hUa0xnHCpxq11+g6uVYoY97SW928/YZdRMunP48L?= =?us-ascii?Q?xMZ3FmS3h9h8k5fu0bDEHa3MB0xPxE7wjy0UK4Je761oPL6rGg2c12wRtSQE?= =?us-ascii?Q?2YNLY//bZJKHJ3JBtHeVmQa4YOIMzQ=3D=3D?= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hgy1laqB5SnWq4kqvJ65ry98DaeE5dS338qJSQq4ZDQwd815yWGoTPRYBJYq?= =?us-ascii?Q?Oy5CGpkSyL51FimpvfMfFLR72zVolVBtGq0lHRhlNmOGX+tTEPbAWIxYV0xp?= =?us-ascii?Q?hXES1iJgSWRt9BL7cagSY8MNtu9l3NZdBh4YKEC4lA2iiPmSxNJmEW1F/c+z?= =?us-ascii?Q?ttj0Tz/1wvEcGJDLwQum5DfeYPlYAKmI4oViQx6wu7Af5utG1N2NT70dqslx?= =?us-ascii?Q?Li64scTwBRWxbdcphatPdgyWxOdWP/88oztL3aiQsc97YOB57vkq3T5/tYLA?= =?us-ascii?Q?poCwUb8AS+TFP0uKMAY7PQ3gs+B7AxTtM8N3CdXr0qOB/3Y/jClVGiyWURZv?= =?us-ascii?Q?g1Qtbx9ZYlv3m9VyG0x+kS5f5p+A3P8PE2EZGGaZi8+e0psJU2JlckW2nhpQ?= =?us-ascii?Q?VFdner6unpieWe6uyiZxB30R4xqR/lfu66ZduX2HRYwtwGqqr5LIub2kdJd1?= =?us-ascii?Q?EY9dJMZ/Tb6R57nEwCapi1FjAzRSWU69XZSmvr/rxZUo2AYLRt9JVj4mGozS?= =?us-ascii?Q?FkQdT5eaHeblnh8Uhw3FR381YnzVYjEXujd6yveQjf+9r2hftjW0q7qbdzf7?= =?us-ascii?Q?oVMv3QG4jL2PO77H5vmVOk4XJnnsQUSLga9WeqQKichaKC2Ms682aRJfZFcj?= =?us-ascii?Q?y74nSHGtBCVZFOlziKw4mz7J3sXMmQad04ZIt1TsxJX0CN5odPSi8sog/FUh?= =?us-ascii?Q?YRku9IdIMhADhnhZKyWEvwsa01SopqDE2PGIYg/6LEYsbfbXQ1oVGQnf7YwN?= =?us-ascii?Q?1SicDOjVWoEe8Is3N72vdEPuJFFLbv4PEU9MDxUhFWhiTyZs3EhhXHMh95nQ?= =?us-ascii?Q?dBLld86RfnpCFr/pnUnRhUqmnuyf6wW3P+OJWIDGbSS4wQkLrwgsACMXhwcY?= =?us-ascii?Q?y1Zqw79gy+A/MW101jpnSojv/E2F75gkY8+/AnX3cVzIvSm7ZRS0emayHcdS?= =?us-ascii?Q?h9JPVl+7DfrpPoB87IQAKRWp1ktfL8jq3fcxdu3fSSordZDxn6FrhOtaMJGE?= =?us-ascii?Q?s4Xa95rU84SOJihHvqZ837XfyLgdS0cMWI3d5pxuY+GRheEKPrGWaiNgaDRZ?= =?us-ascii?Q?qkez+YEa60ljp4AcUXNFXXld54Z2+JujYeFeVEGbeUcyt0qpOt3hJ41HBkkk?= =?us-ascii?Q?pYz1KBPVfjCZuNH5bOy7EJjFQFeNSeEIz52NyVdFqgrM2C9MM1PRbVo4K4xM?= =?us-ascii?Q?Pd/Nnu1YnV+n5OmRZ7NsJO+d7tBMZ2j13SGkEdVdmL2jd2uH84AnisHOd0lW?= =?us-ascii?Q?FFJbbi1sKuPSRbVlKfqzmYKCIL6SGhd+hkD3VlE/2Hlf+QuXG9ZfmlVTuXR9?= =?us-ascii?Q?s8shLZg//NCFFeGjFa1lQfXZbxoPReyceBHmmT7H3dwwqYffs3iCLyPq7mos?= =?us-ascii?Q?pe9tDVFeNzUhwhQCYWyq0LIQOcIZ?= X-OriginatorOrg: sct-15-20-9412-4-msonline-outlook-feddd.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: b8bdb4a5-beb7-424d-12c9-08debd263f78 X-MS-Exchange-CrossTenant-AuthSource: SY7PR01MB10921.ausprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2026 02:01:50.9453 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY4PR01MB8277 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Mats On Tue, 26 May 2026 at 18:03, Mats Kindahl wrote: > > Attached a new version of the patch with the changes you suggested. > I found an error on the Windows platform [1]. [07:08:28.538] >>> MALLOC_PERTURB_=3D168 PG_REGRESS=3DC:\cirrus\build\src/t= est\regress\pg_regress.exe REGRESS_SHLIB=3DC:\cirrus\build\src/test\regress= \regress.dll MSAN_OPTIONS=3Dhalt_on_error=3D1:abort_on_error=3D1:print_summ= ary=3D1:print_stacktrace=3D1 top_builddir=3DC:\cirrus\build UBSAN_OPTIONS= =3Dhalt_on_error=3D1:abort_on_error=3D1:print_summary=3D1:print_stacktrace= =3D1 MESON_TEST_ITERATION=3D1 PATH=3DC:\cirrus\build\tmp_install\usr\local\= pgsql\bin;C:\cirrus\build\src\bin\pg_rewind;C:/cirrus/build/src/bin/pg_rewi= nd/test;C:\VS_2019\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64;C:\VS_2019\MSB= uild\Current\bin\Roslyn;C:\Program Files (x86)\Windows Kits\10\bin\10.0.226= 21.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\VS_2019\\MSBuild= \Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\VS_2019\Com= mon7\IDE\;C:\VS_2019\Common7\Tools\;C:\VS_2019\VC\Auxiliary\Build;C:\zstd\z= std-v1.5.2-win64;C:\zlib;C:\lz4;C:\icu;C:\winflexbison;C:\strawberry\5.42.0= .1\perl\bin;C:\python\Scripts\;C:\python\;C:\Windows Kits\10\Debuggers\x64;= C:\Program Files\Git\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\Syst= em32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\O= penSSH\;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metada= ta_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\= Program Files\PowerShell\7\;C:\Program Files\Google\Compute Engine\sysprep;= C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\Git= \mingw64\bin;C:\Program Files\Git\usr\bin;C:\Windows\system32\config\system= profile\AppData\Local\Microsoft\WindowsApps INITDB_TEMPLATE=3DC:/cirrus/bui= ld/tmp_install/initdb-template ASAN_OPTIONS=3Dhalt_on_error=3D1:abort_on_er= ror=3D1:print_summary=3D1 share_contrib_dir=3DC:/cirrus/build/tmp_install//= usr/local/pgsql/share/contrib C:\python\python3.EXE C:\cirrus\build\..\src/= tools/testwrap --basedir C:\cirrus\build --srcdir C:\cirrus\src\bin\pg_rewi= nd --pg-test-extra --testgroup pg_rewind --testname 005_same_timeline -- C= :\strawberry\5.42.0.1\perl\bin\perl.EXE -I C:/cirrus/src/test/perl -I C:\ci= rrus\src\bin\pg_rewind C:/cirrus/src/bin/pg_rewind/t/005_same_timeline.pl [07:08:28.538] ------------------------------------- 8< -------------------= ------------------ [07:08:28.538] stderr: [07:08:28.538] # Failed test 'pg_rewind rewinds across mismatched TLI 2 /= TLI 2-prime to TLI 1' [07:08:28.538] # at C:/cirrus/src/bin/pg_rewind/t/005_same_timeline.pl li= ne 45. [07:08:28.538] # ---------- command failed ---------- [07:08:28.538] # pg_rewind --debug --source-pgdata C:\cirrus\build/testrun/= pg_rewind/005_same_timeline\data/t_005_same_timeline_node_b2_data/pgdata --= target-pgdata C:\cirrus\build/testrun/pg_rewind/005_same_timeline\data/t_00= 5_same_timeline_node_a2_data/pgdata --no-sync --config-file C:\cirrus\build= \testrun\pg_rewind\005_same_timeline\data\tmp_test_ZCeZ/target-postgresql.c= onf.tmp --restore-target-wal [07:08:28.538] # -------------- stderr -------------- [07:08:28.538] # pg_rewind: using for rewind "restore_command =3D 'cp "C:ci= rrusuild/testrun/pg_rewind/005_same_timelinedata/t_005_same_timeline_node_x= _data/pgdata/pg_wal/%f" "%p"'" [07:08:28.538] # pg_rewind: Source timeline history: [07:08:28.538] # pg_rewind: 1: 0/00000000 - 0/040000E0 [07:08:28.538] # pg_rewind: 2: 0/040000E0 - 0/00000000 [07:08:28.538] # pg_rewind: Target timeline history: [07:08:28.538] # pg_rewind: 1: 0/00000000 - 0/040000E0 [07:08:28.538] # pg_rewind: 2: 0/040000E0 - 0/060000E0 [07:08:28.538] # pg_rewind: 3: 0/060000E0 - 0/00000000 [07:08:28.538] # pg_rewind: servers diverged at WAL location 0/040000E0 on = timeline 1 [07:08:28.538] # cp: cannot stat 'C:cirrus'$'\b''uild/testrun/pg_rewind/005= _same_timelinedata/t_005_same_timeline_node_x_data/pgdata/pg_wal/0000000200= 00000000000004': No such file or directory [07:08:28.538] # pg_rewind: error: could not restore file "0000000200000000= 00000004" from archive [07:08:28.538] # pg_rewind: error: could not find previous WAL record at 0/= 040000E0 [07:08:28.538] # ------------------------------------ [07:08:28.538] # Failed test 'rewound node reflects source history, not t= arget TLI 2/TLI 3 data' [07:08:28.538] # at C:/cirrus/src/bin/pg_rewind/t/005_same_timeline.pl li= ne 260. [07:08:28.538] # got: 'origin2 [07:08:28.538] # x' [07:08:28.538] # expected: 'b [07:08:28.538] # origin2' [07:08:28.538] # Looks like you failed 2 tests of 11. [07:08:28.538]=20 [07:08:28.538] (test program exited with status code 2) [07:08:28.538] ------------------------------------------------------------= ------------------ [07:08:28.538]=20 [1] https://cirrus-ci.com/task/6228217159221248 --=20 Regards, Japin Li ChengDu WenWu Information Technology Co., Ltd.